Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

texture.h

Go to the documentation of this file.
00001 /*
00002         $Id: texture.h,v 1.7 2001/03/04 17:54:49 mbn Exp $
00003 
00004         ------------------------------------------------------------------------
00005         ClanLib, the platform independent game SDK.
00006 
00007         This library is distributed under the GNU LIBRARY GENERAL PUBLIC LICENSE
00008         version 2. See COPYING for details.
00009 
00010         For a total list of contributers see CREDITS.
00011 
00012         ------------------------------------------------------------------------
00013 */
00014 
00016 
00017 #ifndef header_texture
00018 #define header_texture
00019 
00020 class CL_SurfaceProvider;
00021 class CL_ResourceManager;
00022 class CL_DisplayCard;
00023 
00024 class CL_Texture
00025 //: Texture loading class for OpenGL.
00026 // <p>This class can load the image(s) from surface provider into OpenGL
00027 // textures.</p>
00028 //
00029 // <p>This class works just like a <a class="CL_Surface">surface</a>, except that it
00030 // requires the image width to be 2^n.</p>
00031 {
00032 public:
00033         static CL_Texture *create(CL_SurfaceProvider *provider, bool delete_provider=false);
00034         // Creates a texture from a surface provider.
00038 
00039         static CL_Texture *load(const char *id, CL_ResourceManager *manager);
00040         // Load the texture from a surface resource.
00043 
00044         virtual ~CL_Texture() { ; }
00045 
00046         virtual void bind(int texture_no=0)=0;
00047         // Bind the texture in OpenGL.
00049 
00050         virtual CL_SurfaceProvider *get_provider() const =0;
00051         // Returns the surface provider.
00052 
00053         virtual void reload()=0; 
00054         //: Forces surface to reload texture data from provider.
00055 
00056         virtual int get_width() const =0;
00057         //: Returns the width of the surface
00059 
00060         virtual int get_height() const =0;
00061         //: Returns the height of the texture
00063 
00064         virtual int get_num_frames() const =0;
00065         //: Returns the number of subtextures in the texture
00067 
00068         virtual void flush(CL_DisplayCard *card = NULL)=0;
00069         //: completely flushes textures (removes from video/system-memory)
00070 };
00071 
00072 #endif

Generated at Wed Apr 4 19:54:04 2001 for ClanLib by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001