CrystalSpace

Public API Reference

ivideo/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_interface.h"
00032 #include "cstypes.h"
00033 #include "ivideo/graph3d.h"
00034 
00035 struct iGraphics2D;
00036 struct iGraphics3D;
00037 
00038 
00051 struct iTextureHandle : public virtual iBase
00052 {
00053   SCF_INTERFACE(iTextureHandle, 3,0,0);
00055   virtual int GetFlags () const = 0;
00056 
00058   virtual void SetKeyColor (bool Enable) = 0;
00059 
00061   virtual void SetKeyColor (uint8 red, uint8 green, uint8 blue) = 0;
00062 
00064   virtual bool GetKeyColor () const = 0;
00065 
00067   virtual void GetKeyColor (uint8 &red, uint8 &green, uint8 &blue) const = 0;
00068 
00078   virtual bool GetRendererDimensions (int &mw, int &mh) = 0;
00079 
00087   virtual void GetOriginalDimensions (int& mw, int& mh) = 0;
00088 
00089   // CHANGED TO ADD SUPPORT FOR CUBEMAPS AND 3D TEXTURES
00090   // done by Phil Aumayr (phil@rarebyte.com)
00091   enum 
00092   { 
00093     CS_TEX_IMG_1D = 0, 
00094     CS_TEX_IMG_2D, 
00095     CS_TEX_IMG_3D, 
00096     CS_TEX_IMG_CUBEMAP,
00097     CS_TEX_IMG_RECT
00098   };
00102   enum { CS_TEXTURE_CUBE_POS_X = 0, CS_TEXTURE_CUBE_NEG_X, 
00103          CS_TEXTURE_CUBE_POS_Y, CS_TEXTURE_CUBE_NEG_Y,
00104          CS_TEXTURE_CUBE_POS_Z, CS_TEXTURE_CUBE_NEG_Z };
00105 
00106 
00116   virtual bool GetRendererDimensions (int &mw, int &mh, int &md) = 0;
00117 
00125   virtual void GetOriginalDimensions (int& mw, int& mh, int &md) = 0;
00126 
00131   virtual int GetTextureTarget () const = 0;
00132 
00134   enum TextureBlitDataFormat
00135   {
00137     RGBA8888 = 0,
00139     BGRA8888
00140   };
00141 
00149   virtual void Blit (int x, int y, int width, int height,
00150     unsigned char const* data, TextureBlitDataFormat format = RGBA8888) = 0;
00151 
00155   virtual const char* GetImageName () const = 0;
00156 
00161   virtual void *GetPrivateObject () = 0;
00162 
00168   virtual bool GetAlphaMap () = 0;
00169 
00171   virtual csAlphaMode::AlphaType GetAlphaType () const = 0;
00172 
00177   virtual void Precache () = 0;
00178 
00189   virtual void SetTextureClass (const char* className) = 0;
00194   virtual const char* GetTextureClass () = 0;
00195 
00202   virtual void SetAlphaType (csAlphaMode::AlphaType alphaType) = 0;
00203 };
00204 
00207 #endif // __CS_IVIDEO_TEXTURE_H__

Generated for Crystal Space 1.2.1 by doxygen 1.5.3