CrystalSpace

Public API Reference

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

texture.h

Go to the documentation of this file.
00001 /*
00002     Copyright (C) 1998, 2000 by Jorrit Tyberghein
00003                         2004 by Marten Svanfeldt
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_IVIDEO_TEXTURE_H__
00021 #define __CS_IVIDEO_TEXTURE_H__
00022 
00031 #include "csutil/scf.h"
00032 #include "cstypes.h"
00033 #include "ivideo/graph3d.h"
00034 
00035 struct iGraphics2D;
00036 struct iGraphics3D;
00037 
00038 SCF_VERSION (iTextureHandle, 2, 4, 0);
00039 
00056 struct iTextureHandle : public iBase
00057 {
00059   virtual int GetFlags () const = 0;
00060 
00062   virtual void SetKeyColor (bool Enable) = 0;
00063 
00065   virtual void SetKeyColor (uint8 red, uint8 green, uint8 blue) = 0;
00066 
00068   virtual bool GetKeyColor () const = 0;
00069 
00071   virtual void GetKeyColor (uint8 &red, uint8 &green, uint8 &blue) const = 0;
00072 
00082   virtual bool GetRendererDimensions (int &mw, int &mh) = 0;
00083 
00091   virtual void GetOriginalDimensions (int& mw, int& mh) = 0;
00092 
00093   // CHANGED TO ADD SUPPORT FOR CUBEMAPS AND 3D TEXTURES
00094   // done by Phil Aumayr (phil@rarebyte.com)
00095   enum { CS_TEX_IMG_1D = 0, CS_TEX_IMG_2D, CS_TEX_IMG_3D, CS_TEX_IMG_CUBEMAP };
00099   enum { CS_TEXTURE_CUBE_POS_X = 0, CS_TEXTURE_CUBE_NEG_X, 
00100          CS_TEXTURE_CUBE_POS_Y, CS_TEXTURE_CUBE_NEG_Y,
00101          CS_TEXTURE_CUBE_POS_Z, CS_TEXTURE_CUBE_NEG_Z };
00102 
00103 
00113   virtual bool GetRendererDimensions (int &mw, int &mh, int &md) = 0;
00114 
00122   virtual void GetOriginalDimensions (int& mw, int& mh, int &md) = 0;
00123 
00128   virtual int GetTextureTarget () const = 0;
00129 
00134   virtual void Blit (int x, int y, int width, int height,
00135     unsigned char const* data) = 0;
00136 
00140   virtual const char* GetImageName () const = 0;
00141 
00143   virtual void GetMeanColor (uint8 &red, uint8 &green, uint8 &blue) const = 0;
00144 
00146   virtual void *GetCacheData () = 0;
00147 
00149   virtual void SetCacheData (void *d) = 0;
00150 
00155   virtual void *GetPrivateObject () = 0;
00156 
00162   virtual bool GetAlphaMap () = 0;
00163 
00165   virtual csAlphaMode::AlphaType GetAlphaType () const = 0;
00166 
00171   virtual void Precache () = 0;
00172 
00183   virtual void SetTextureClass (const char* className) = 0;
00188   virtual const char* GetTextureClass () = 0;
00189 
00196   virtual void SetAlphaType (csAlphaMode::AlphaType alphaType) = 0;
00197 };
00198 
00201 #endif // __CS_IVIDEO_TEXTURE_H__

Generated for Crystal Space by doxygen 1.3.9.1