00001
00002
00003 #ifndef __FRAME_BUFFER_GL_H
00004 #define __FRAME_BUFFER_GL_H
00005
00006 #include <gra/framebuffer/FrameBuffer.h>
00007 #include <esg/Definitions.h>
00008 #include <GL/gl.h>
00009
00010 using namespace esg;
00011
00012 namespace gra {
00013
00014 class GRA_EXPORT FrameBufferGL : public FrameBuffer {
00015 public:
00021 FrameBufferGL(unsigned mode) : FrameBuffer(mode) {}
00022
00030 FrameBufferGL(unsigned width, unsigned height, unsigned mode)
00031 : FrameBuffer(width, height, mode) { glViewport(0, 0, width, height); }
00032
00036 virtual ~FrameBufferGL() {}
00037
00042 virtual void showContent() { glFlush(); }
00043
00047 virtual void setWidth (unsigned);
00048 virtual void setHeight(unsigned);
00049
00062 virtual void setColor(const Camera& ,
00063 unsigned ,
00064 unsigned ,
00065 float ,
00066 const Color3f& );
00067
00068 virtual void setColor(const Camera& ,
00069 unsigned ,
00070 unsigned ,
00071 const Color3f& );
00072
00086 virtual void setColors(const Camera& ,
00087 unsigned ,
00088 unsigned ,
00089 float ,
00090 const Color3f [] ,
00091 unsigned );
00092
00093 virtual void setColors(const Camera& ,
00094 unsigned ,
00095 unsigned ,
00096 const Color3f [] ,
00097 unsigned );
00098
00109 virtual Color3f getColor(unsigned ,
00110 unsigned ) const;
00111
00117 virtual void clearColor(const Color3f& );
00118
00119
00120 #if 0
00121 virtual int init ();
00122 virtual int showContent ();
00123 virtual int getWidth () const = 0;
00124 virtual int getHeight () const = 0;
00125 virtual int setWidth (unsigned) = 0;
00126 virtual int setHeight (unsigned) = 0;
00127 virtual int setColor (unsigned, unsigned, const Color3f&);
00128 virtual Color3f getColor (unsigned, unsigned) const { return Color3f(0,0,0); }
00129 virtual int setActive () = 0;
00130 virtual int clear (const Color3f&);
00131 #endif
00132 };
00133
00134 }
00135
00136 #endif // __FRAME_BUFFER_GL_H