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

target_system.h

Go to the documentation of this file.
00001 /*
00002         $Id: target_system.h,v 1.1 2001/03/06 15:09:17 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_target_system
00016 #define header_target_system
00017 
00018 #include "API/Core/Display/target.h"
00019 
00020 class CL_Target_System : public CL_Target
00021 {
00022 public:
00023         CL_Target_System(
00024                 int width,
00025                 int height,
00026                 int bytes_per_pixel,
00027                 int red_mask,
00028                 int green_mask,
00029                 int blue_mask,
00030                 int alpha_mask)
00031         {
00032                 m_width = width;
00033                 m_height = height;
00034                 m_bytes_per_pixel = bytes_per_pixel;
00035                 m_red_mask = red_mask;
00036                 m_green_mask = green_mask;
00037                 m_blue_mask = blue_mask;
00038                 m_alpha_mask = alpha_mask;
00039                 
00040                 m_buffer = new unsigned char[
00041                         width*height*bytes_per_pixel];
00042         }
00043         
00044         virtual ~CL_Target_System()
00045         {
00046                 delete[] m_buffer;
00047         }
00048 
00049         virtual void lock() { return; }
00050         virtual void unlock() { return; }
00051 
00052         virtual void *get_data() const { return m_buffer; }
00053 
00054         virtual unsigned int get_width() const { return m_width; }
00055         virtual unsigned int get_height() const { return m_height; }
00056         virtual unsigned int get_pitch() const { return m_width*m_bytes_per_pixel; }
00057 
00058         virtual unsigned int get_depth() const { return m_bytes_per_pixel*8; }
00059         virtual unsigned int get_red_mask() const { return m_red_mask; }
00060         virtual unsigned int get_green_mask() const { return m_green_mask; }
00061         virtual unsigned int get_blue_mask() const { return m_blue_mask; }
00062         virtual unsigned int get_alpha_mask() const { return m_alpha_mask; }
00063         virtual unsigned int get_num_frames() const { return 1; }
00064         virtual bool is_indexed() const { return false; }
00065 
00066         virtual CL_Palette *get_palette() const { return NULL; }
00067         
00068 private:
00069         unsigned int m_width;
00070         unsigned int m_height;
00071         unsigned int m_bytes_per_pixel;
00072         unsigned int m_red_mask;
00073         unsigned int m_green_mask;
00074         unsigned int m_blue_mask;
00075         unsigned int m_alpha_mask;
00076         unsigned char *m_buffer;
00077 };
00078 
00079 #endif

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