CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

csws/csbackgr.h

Go to the documentation of this file.
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 __CS_CSBACKGR_H__
00021 #define __CS_CSBACKGR_H__
00022 
00031 #include "csextern.h"
00032  
00033 #include "csgfx/rgbpixel.h"
00034 
00035 struct iTextureHandle;
00036 class csApp;
00037 class csComponent;
00038 
00040 enum csBackgroundType
00041 {
00043   csbgNone = 0,
00045   csbgColor,
00047   csbgGradient,
00049   csbgTextured
00050 };
00051 
00056 class CS_CSWS_EXPORT csBackground
00057 {
00059   csBackgroundType type;
00061   iTextureHandle *tex;
00063   csRGBcolor colors [4];
00065   int color;
00066 
00067 public:
00069   csBackground ();
00070 
00072   ~csBackground ();
00073 
00075   void Free ()
00076   { SetTexture (0); }
00077 
00079   void SetTexture (iTextureHandle *iTex);
00080 
00082   iTextureHandle *GetTexture ()
00083   { return tex; }
00084 
00086   void SetColor (int iIndex, csRGBcolor &iColor)
00087   { colors [iIndex] = iColor; type = csbgGradient; }
00088 
00090   csRGBcolor &GetColor (int iIndex)
00091   { return colors [iIndex]; }
00092 
00094   void SetColor (int iColor)
00095   { color = iColor; type = csbgColor; }
00096 
00098   int GetColor ()
00099   { return color; }
00100 
00102   void SetType (csBackgroundType iType)
00103   { type = iType; }
00104 
00106   csBackgroundType GetType ()
00107   { return type; }
00108 
00110   void Draw (csComponent &This, int x, int y, int w, int h,
00111     int xorg, int yorg, uint8 iAlpha);
00112 };
00113 
00116 #endif // __CS_CSBACKGR_H__

Generated for Crystal Space by doxygen 1.2.18