Panda3D

glxGraphicsWindow.h

00001 // Filename: glxGraphicsWindow.h
00002 // Created by:  mike (09Jan97)
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 GLXGRAPHICSWINDOW_H
00016 #define GLXGRAPHICSWINDOW_H
00017 
00018 #include "pandabase.h"
00019 
00020 #include "x11GraphicsWindow.h"
00021 #include "glxGraphicsPipe.h"
00022 #include "graphicsWindow.h"
00023 #include "buttonHandle.h"
00024 
00025 ////////////////////////////////////////////////////////////////////
00026 //       Class : glxGraphicsWindow
00027 // Description : An interface to the glx system for managing GL
00028 //               windows under X.
00029 ////////////////////////////////////////////////////////////////////
00030 class glxGraphicsWindow : public x11GraphicsWindow {
00031 public:
00032   glxGraphicsWindow(GraphicsEngine *engine, GraphicsPipe *pipe, 
00033                     const string &name,
00034                     const FrameBufferProperties &fb_prop,
00035                     const WindowProperties &win_prop,
00036                     int flags,
00037                     GraphicsStateGuardian *gsg,
00038                     GraphicsOutput *host);
00039   virtual ~glxGraphicsWindow() {};
00040 
00041   virtual bool begin_frame(FrameMode mode, Thread *current_thread);
00042   virtual void end_flip();
00043 
00044 protected:
00045   virtual void close_window();
00046   virtual bool open_window();
00047 
00048 private:
00049   virtual void setup_colormap(GLXFBConfig fbconfig);
00050   virtual void setup_colormap(XVisualInfo *visual);
00051   
00052 public:
00053   static TypeHandle get_class_type() {
00054     return _type_handle;
00055   }
00056   static void init_type() {
00057     x11GraphicsWindow::init_type();
00058     register_type(_type_handle, "glxGraphicsWindow",
00059                   x11GraphicsWindow::get_class_type());
00060   }
00061   virtual TypeHandle get_type() const {
00062     return get_class_type();
00063   }
00064   virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00065 
00066 private:
00067   static TypeHandle _type_handle;
00068 };
00069 
00070 #endif
 All Classes Functions Variables Enumerations