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

lockable_surface_gl.h

Go to the documentation of this file.
00001 /*
00002         $Id: lockable_surface_gl.h,v 1.1.1.1 2000/04/09 12:18:02 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 
00015 #ifndef header_dynamic_surface_gl
00016 #define header_dynamic_surface_gl
00017 
00018 /*
00019 #ifdef WIN32
00020         #include <windows.h>
00021 #endif
00022 */
00023 #include <GL/gl.h>
00024 #include "API/Core/Display/surface.h"
00025 
00026 class CL_GL_DisplayCard_Generic;
00027 class CL_DynamicSurface_GL : public CL_Surface
00028 {
00029 public:
00030         CL_LockableSurface_GL(
00031                 int width,
00032                 int height,
00033                 int no_sprs,
00034                 int minimum_alpha_mask_size,
00035                 CL_GL_DisplayCard_Generic *card);
00036 
00037         virtual ~CL_LockableSurface_GL();
00038 
00039         // From CL_Target:
00040         // ---------------
00041         virtual void lock() { return; }
00042         virtual void unlock();
00043 
00044         virtual void *get_data() { return m_data; }
00045 
00046         virtual unsigned int get_width() { return m_width; }
00047         virtual unsigned int get_height() { return m_height; }
00048         virtual unsigned int get_pitch() { return m_width*sizeof(int); }
00049 
00050         virtual unsigned int get_depth() { return sizeof(int)*8; }
00051 
00052         virtual unsigned int get_red_mask() { return 0xff000000; }
00053         virtual unsigned int get_green_mask() { return 0x00ff0000; }
00054         virtual unsigned int get_blue_mask() { return 0x0000ff00; }
00055         virtual unsigned int get_alpha_mask() { return m_alpha_mask; }
00056 
00057         virtual CL_Palette *get_palette() { return NULL; }
00058 
00059         // From CL_LockableSurface:
00060         // ------------------------
00061         virtual void set_colorkey(int colorkey);
00062         virtual int get_colorkey() const;
00063 
00064         virtual unsigned int get_no_sprs() const;
00065 
00066         virtual void put_screen(int x, int y, int spr_no);
00067         virtual void put_screen(int x, int y, float scale_x, float scale_y, int spr_no);
00068         virtual void put_screen(int x, int y, int size_x, int size_y, int spr_no);
00069 
00070 private:
00071         int *m_data;
00072         int m_colorkey, 
00073             m_no_sprs, 
00074             m_width, 
00075             m_height,
00076             m_alpha_mask,
00077             m_texture_width,
00078             m_texture_height;
00079 
00080         GLuint m_texture;
00081 
00082         CL_GL_DisplayCard_Generic *m_card;
00083 };
00084 
00085 #endif

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