Panda3D
 All Classes Functions Variables Enumerations
glxGraphicsBuffer.h
00001 // Filename: glxGraphicsBuffer.h
00002 // Created by:  drose (09Feb04)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 #ifndef GLXGRAPHICSBUFFER_H
00016 #define GLXGRAPHICSBUFFER_H
00017 
00018 #include "pandabase.h"
00019 
00020 #include "glxGraphicsPipe.h"
00021 #include "graphicsBuffer.h"
00022 
00023 ////////////////////////////////////////////////////////////////////
00024 //       Class : glxGraphicsBuffer
00025 // Description : An offscreen buffer in the GLX environment.  This
00026 //               creates a GLXPbuffer.
00027 ////////////////////////////////////////////////////////////////////
00028 class glxGraphicsBuffer : public GraphicsBuffer {
00029 public:
00030   glxGraphicsBuffer(GraphicsEngine *engine, GraphicsPipe *pipe, 
00031                     const string &name,
00032                     const FrameBufferProperties &fb_prop,
00033                     const WindowProperties &win_prop,
00034                     int flags,
00035                     GraphicsStateGuardian *gsg,
00036                     GraphicsOutput *host);
00037   virtual ~glxGraphicsBuffer();
00038 
00039   virtual bool begin_frame(FrameMode mode, Thread *current_thread);
00040   virtual void end_frame(FrameMode mode, Thread *current_thread);
00041 
00042 protected:
00043   virtual void close_buffer();
00044   virtual bool open_buffer();
00045 
00046 private:
00047   X11_Display *_display;
00048   GLXPbuffer _pbuffer;
00049 
00050 public:
00051   static TypeHandle get_class_type() {
00052     return _type_handle;
00053   }
00054   static void init_type() {
00055     GraphicsBuffer::init_type();
00056     register_type(_type_handle, "glxGraphicsBuffer",
00057                   GraphicsBuffer::get_class_type());
00058   }
00059   virtual TypeHandle get_type() const {
00060     return get_class_type();
00061   }
00062   virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00063 
00064 private:
00065   static TypeHandle _type_handle;
00066 };
00067 
00068 #include "glxGraphicsBuffer.I"
00069 
00070 #endif
 All Classes Functions Variables Enumerations