00001 /* 00002 $Id: dx_target.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_dx_target 00016 #define header_dx_target 00017 00018 #include <ddraw.h> 00019 #include "API/Display/Display/palette.h" 00020 #include "API/Display/Display/target.h" 00021 00022 class CL_Target_DX : public CL_Target 00023 { 00024 public: 00025 CL_Target_DX(LPDIRECTDRAWSURFACE surface); 00026 virtual ~CL_Target_DX(); 00027 00028 virtual void lock(); 00029 virtual void unlock(); 00030 00031 virtual bool is_video() { return m_surface_is_video; } 00032 virtual void *get_data() const { return m_data; } 00033 00034 virtual unsigned int get_num_frames() const { return 1; } 00035 virtual unsigned int get_width() const { return m_width; } 00036 virtual unsigned int get_height() const { return m_height; } 00037 virtual unsigned int get_pitch() const { return m_pitch; } 00038 00039 virtual unsigned int get_depth() const { return m_depth; } 00040 virtual unsigned int get_red_mask() const { return m_red_mask; } 00041 virtual unsigned int get_green_mask() const { return m_green_mask; } 00042 virtual unsigned int get_blue_mask() const { return m_blue_mask; } 00043 virtual unsigned int get_alpha_mask() const { return m_alpha_mask; } 00044 00045 virtual CL_Palette *get_palette() const; 00046 virtual void set_palette(CL_Palette *pal); 00047 00048 virtual bool is_indexed() const { return get_depth()==8; } 00049 00050 LPDIRECTDRAWSURFACE get_surface() { return m_surface; } 00051 00052 protected: 00053 void set_surface(LPDIRECTDRAWSURFACE surface); 00054 void get_palette_from_surface(); 00055 00056 LPDIRECTDRAWSURFACE m_surface; 00057 bool m_surface_is_video; 00058 void *m_data; 00059 unsigned int m_width, m_height, m_pitch, m_depth; 00060 unsigned int m_red_mask, m_green_mask, m_blue_mask, m_alpha_mask; 00061 CL_Palette m_palette; 00062 unsigned int m_ref_count; 00063 }; 00064 00065 #endif
1.2.6 written by Dimitri van Heesch,
© 1997-2001