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, 4,0,3); 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 //CS_DEPRECATED_TYPE 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 00132 CS_DEPRECATED_METHOD_MSG("Use GetTextureType() instead") 00133 virtual int GetTextureTarget () const = 0; 00134 00136 enum TextureBlitDataFormat 00137 { 00139 RGBA8888 = 0, 00141 BGRA8888 00142 }; 00143 00151 virtual void Blit (int x, int y, int width, int height, 00152 unsigned char const* data, TextureBlitDataFormat format = RGBA8888) = 0; 00153 00157 virtual const char* GetImageName () const = 0; 00158 00163 virtual void *GetPrivateObject () = 0; 00164 00170 virtual bool GetAlphaMap () = 0; 00171 00173 virtual csAlphaMode::AlphaType GetAlphaType () const = 0; 00174 00179 virtual void Precache () = 0; 00180 00184 virtual bool IsPrecached () = 0; 00185 00196 virtual void SetTextureClass (const char* className) = 0; 00201 virtual const char* GetTextureClass () = 0; 00202 00209 virtual void SetAlphaType (csAlphaMode::AlphaType alphaType) = 0; 00210 00212 enum TextureType 00213 { 00215 texType1D = 0, 00217 texType2D, 00219 texType3D, 00221 texTypeCube, 00223 texTypeRect 00224 }; 00225 00231 virtual TextureType GetTextureType() const = 0; 00232 00233 enum 00234 { 00236 blitbufReadable = 1, 00243 blitbufRetainArea = 2 00244 }; 00245 00266 virtual uint8* QueryBlitBuffer (int x, int y, int width, int height, 00267 size_t& pitch, TextureBlitDataFormat format = RGBA8888, 00268 uint bufFlags = 0) = 0; 00270 virtual void ApplyBlitBuffer (uint8* buf) = 0; 00272 enum BlitBufferNature 00273 { 00282 natureIndirect = 0, 00287 natureDirect = 1 00288 }; 00289 virtual BlitBufferNature GetBufferNature (uint8* buf) = 0; 00290 }; 00291 00294 #endif // __CS_IVIDEO_TEXTURE_H__
Generated for Crystal Space 1.4.0 by doxygen 1.5.8