00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __CS_CSBACKGR_H__
00021 #define __CS_CSBACKGR_H__
00022
00031 #include "csgfx/rgbpixel.h"
00032
00033 struct iTextureHandle;
00034 class csApp;
00035 class csComponent;
00036
00038 enum csBackgroundType
00039 {
00041 csbgNone = 0,
00043 csbgColor,
00045 csbgGradient,
00047 csbgTextured
00048 };
00049
00054 class csBackground
00055 {
00057 csBackgroundType type;
00059 iTextureHandle *tex;
00061 csRGBcolor colors [4];
00063 int color;
00064
00065 public:
00067 csBackground ();
00068
00070 ~csBackground ();
00071
00073 void Free ()
00074 { SetTexture (0); }
00075
00077 void SetTexture (iTextureHandle *iTex);
00078
00080 iTextureHandle *GetTexture ()
00081 { return tex; }
00082
00084 void SetColor (int iIndex, csRGBcolor &iColor)
00085 { colors [iIndex] = iColor; type = csbgGradient; }
00086
00088 csRGBcolor &GetColor (int iIndex)
00089 { return colors [iIndex]; }
00090
00092 void SetColor (int iColor)
00093 { color = iColor; type = csbgColor; }
00094
00096 int GetColor ()
00097 { return color; }
00098
00100 void SetType (csBackgroundType iType)
00101 { type = iType; }
00102
00104 csBackgroundType GetType ()
00105 { return type; }
00106
00108 void Draw (csComponent &This, int x, int y, int w, int h,
00109 int xorg, int yorg, uint8 iAlpha);
00110 };
00111
00114 #endif // __CS_CSBACKGR_H__