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

target_ximage_shm.h

Go to the documentation of this file.
00001 /*
00002         $Id: target_ximage_shm.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_ximage_shm
00016 #define header_target_ximage_shm
00017 
00018 #ifdef USE_X11
00019 
00020 #include "target_ximage.h"
00021 
00022 #include <sys/types.h>
00023 #include <sys/ipc.h>
00024 #include <sys/shm.h>
00025 #include <X11/extensions/XShm.h>
00026 
00027 class CL_Target_XImage_Shm : public CL_Target_XImage
00028 {
00029 public:
00030         CL_Target_XImage_Shm(
00031                 XVisualInfo visual_info,
00032                 Display *dpy,
00033                 unsigned int width,
00034                 unsigned int height);
00035                 
00036         virtual ~CL_Target_XImage_Shm();
00037 
00038         virtual void lock();
00039         virtual void unlock();
00040 
00041         virtual void *get_data() const;
00042 
00043         virtual unsigned int get_width() const;
00044         virtual unsigned int get_height() const;
00045         virtual unsigned int get_pitch() const;
00046         
00047         virtual unsigned int get_depth() const;
00048         virtual unsigned int get_red_mask() const;
00049         virtual unsigned int get_green_mask() const;
00050         virtual unsigned int get_blue_mask() const;
00051         virtual unsigned int get_alpha_mask() const;
00052         virtual unsigned int get_num_frames() const { return 1; }
00053         virtual bool is_indexed() const;
00054 
00055         virtual CL_Palette *get_palette() const;
00056         
00057         virtual void put_image(int x, int y, Drawable win, GC gc);
00058         virtual void put_image(int x, int y, const class CL_Rect &rect, Drawable win, GC gc);
00059         
00060 protected:
00061         XVisualInfo m_visual_info;
00062         Display *m_dpy;
00063         
00064         unsigned int m_width;
00065         unsigned int m_height;
00066         unsigned int m_depth, m_pitch;
00067 
00068         XImage *m_shm_image;
00069         XShmSegmentInfo m_shminfo;
00070 };
00071 
00072 #endif /*USE_X11*/
00073 
00074 #endif

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