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

surfaceprovider.h

Go to the documentation of this file.
00001 /*
00002         $Id: surfaceprovider.h,v 1.1 2001/03/06 15:09:10 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_surfaceprovider
00018 #define header_surfaceprovider
00019 
00020 #include "target.h"
00021 class CL_ResourceManager;
00022 
00023 class CL_SurfaceProvider : public CL_Target
00024 //: The image source interface.
00025 // <p>This is the interface used by a <a class="CL_Surface">surface</a> to
00026 // load an image. For more information about the relationship between a
00027 // surface and its provider, please the CL_Surface class description.</p>
00028 //
00029 // <p>The surface provider interface extends the <a
00030 // class="CL_Target">renderer target interface</a> with some blitting
00031 // related functions. Currently, this is translation of the image and
00032 // colorkey transparency.</p>
00033 //
00034 // <p>ClanLib includes a large range of surface providers that can load an
00035 // image from various sources: PCX, TGA, PNG and so on.</p>
00036 //
00037 // <p>If you want to be able to load your (newly created) surface provider
00038 // as a resource, you have to implement the CL_ResourceSource_Surface as
00039 // well.</p>
00040 {
00041 public:
00042         static CL_SurfaceProvider *load(
00043                 const char *resource_id,
00044                 CL_ResourceManager *manager);
00045         //: This function loads a surface provider from a resource file (usually a datafile).
00046 
00047         virtual ~CL_SurfaceProvider() {;}
00048 
00049         virtual int get_translate_x() const { return 0; }
00050         //: Returns the offset of the surface_data returned 
00051         //: by get_data(). This translation will 
00052         //: be applied to every putscreen using a given 
00053         //: surfaceproviders data as input.
00055 
00056         virtual int get_translate_y() const { return 0; }
00057         //: Returns the offset of the surface_data returned 
00058         //: by get_data(). This translation will 
00059         //: be applied to every putscreen using a given 
00060         //: surfaceproviders data as input.
00062 
00063         virtual bool uses_src_colorkey() const =0;
00064         //: Returns true if the surface provider uses a source color key.
00065 
00066         virtual unsigned int get_src_colorkey() const =0;
00067         //: Returns the source color key.
00068 };
00069 
00070 #endif

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