00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __CSBACKGR_H__
00021 #define __CSBACKGR_H__
00022
00023 #include "csgfx/rgbpixel.h"
00024
00025 struct iTextureHandle;
00026 class csApp;
00027 class csComponent;
00028
00030 enum csBackgroundType
00031 {
00033 csbgNone = 0,
00035 csbgColor,
00037 csbgGradient,
00039 csbgTextured
00040 };
00041
00046 class csBackground
00047 {
00049 csBackgroundType type;
00051 iTextureHandle *tex;
00053 csRGBcolor colors [4];
00055 int color;
00056
00057 public:
00059 csBackground ();
00060
00062 ~csBackground ();
00063
00065 void Free ()
00066 { SetTexture (NULL); }
00067
00069 void SetTexture (iTextureHandle *iTex);
00070
00072 iTextureHandle *GetTexture ()
00073 { return tex; }
00074
00076 void SetColor (int iIndex, csRGBcolor &iColor)
00077 { colors [iIndex] = iColor; type = csbgGradient; }
00078
00080 csRGBcolor &GetColor (int iIndex)
00081 { return colors [iIndex]; }
00082
00084 void SetColor (int iColor)
00085 { color = iColor; type = csbgColor; }
00086
00088 int GetColor ()
00089 { return color; }
00090
00092 void SetType (csBackgroundType iType)
00093 { type = iType; }
00094
00096 csBackgroundType GetType ()
00097 { return type; }
00098
00100 void Draw (csComponent &This, int x, int y, int w, int h,
00101 int xorg, int yorg, uint8 iAlpha);
00102 };
00103
00104 #endif // __CSBACKGR_H__