Google

Main Page   Class Hierarchy   Compound List   File List   Compound Members  

csbackgr.h

00001 /*
00002     Crystal Space Windowing System: background class
00003     Copyright (C) 2000 by Andrew Zabolotny <bit@eltech.ru>
00004 
00005     This library is free software; you can redistribute it and/or
00006     modify it under the terms of the GNU Library General Public
00007     License as published by the Free Software Foundation; either
00008     version 2 of the License, or (at your option) any later version.
00009 
00010     This library is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013     Library General Public License for more details.
00014 
00015     You should have received a copy of the GNU Library General Public
00016     License along with this library; if not, write to the Free
00017     Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
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__

Generated for Crystal Space by doxygen 1.2.5 written by Dimitri van Heesch, ©1997-2000