FrameBufferGLX.h

Go to the documentation of this file.
00001 /* $Id:$ */
00002 
00003 #ifndef __FRAME_BUFFER_GLX_H
00004 #define __FRAME_BUFFER_GLX_H
00005 
00006 #include <gra/framebuffer/FrameBuffer.h>
00007 #include <GL/glx.h>
00008 #include <GL/gl.h>
00009 #include <unistd.h>
00010 
00011 using namespace esg;
00012 
00013 namespace gra {
00014 
00015 class GRA_EXPORT FrameBufferGLX : public FrameBuffer {
00016     protected:
00017         Display            * _pDisplay;
00018         XVisualInfo        * _pVisualInfo;
00019         Colormap             _colormap;
00020         Window               _win;
00021         GLXContext           _context;
00022         XEvent               _event;
00023         XSetWindowAttributes _winAttr;
00024         XImage             * _pImage;
00025         XGCValues            _gcValues;
00026         GC                   _gc;
00027         
00028         unsigned long _shiftRed;
00029         unsigned long _shiftGreen;
00030         unsigned long _shiftBlue;
00031         bool          _byteRev;
00032 
00033     protected:
00034         void _init(const char *);
00035         void _destroy();
00036         
00037     public:
00044         FrameBufferGLX(unsigned mode, const char * name = NULL)
00045             : FrameBuffer(mode) { _init(name); }
00046         FrameBufferGLX(unsigned width, unsigned height, unsigned mode, const char * name = NULL)
00047             : FrameBuffer(width, height, mode) { _init(name); }
00048     
00052         virtual ~FrameBufferGLX() { _destroy(); }
00053 
00057         virtual void setWidth (unsigned);
00058         virtual void setHeight(unsigned);
00059 
00064         virtual void showContent();
00065 
00078         virtual void setColor(const Camera&  /* camera */,
00079                               unsigned       /* posX   */,
00080                               unsigned       /* posY   */,
00081                               float          /* depth  */,
00082                               const Color3f& /* color  */);
00083         
00084         virtual void setColor(const Camera&  /* camera */,
00085                               unsigned       /* posX   */,
00086                               unsigned       /* posY   */,
00087                               const Color3f& /* color  */);
00088         
00102         virtual void setColors(const Camera&    /* camera */,
00103                                unsigned         /* posX   */,
00104                                unsigned         /* posY   */,
00105                                float            /* depth  */,
00106                                const Color3f [] /* colors */,
00107                                unsigned         /* size   */);
00108         
00109         virtual void setColors(const Camera&    /* camera */,
00110                                unsigned         /* posX   */,
00111                                unsigned         /* posY   */,
00112                                const Color3f [] /* colors */,
00113                                unsigned         /* size   */);
00114 
00125         virtual Color3f getColor(unsigned /* posX */,
00126                                  unsigned /* posY */) const;
00127 
00133         virtual void clearColor(const Color3f& /* color */);
00134 
00135 };
00136 
00137 } // namespace
00138 
00139 #endif // __FRAME_BUFFER_GLX_H

Generated on Tue Nov 21 15:11:42 2006 for gra by  doxygen 1.4.6