Panda3D
|
00001 // Filename: glxGraphicsPipe.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 GLXGRAPHICSPIPE_H 00016 #define GLXGRAPHICSPIPE_H 00017 00018 #include "pandabase.h" 00019 #include "graphicsWindow.h" 00020 #include "graphicsPipe.h" 00021 #include "glgsg.h" 00022 #include "lightMutex.h" 00023 #include "lightReMutex.h" 00024 #include "x11GraphicsPipe.h" 00025 00026 class FrameBufferProperties; 00027 00028 #ifndef CPPPARSER 00029 00030 // Don't pick up the system glxext.h; use our own, which is better. 00031 #define __glxext_h_ 00032 00033 #include "pre_x11_include.h" 00034 #include <GL/glx.h> 00035 #include "post_x11_include.h" 00036 00037 // This must be included after we have included glgsg.h (which 00038 // includes gl.h), and after we have checked GLX_VERSION_1_3. But we 00039 // must also include it before we redefine the GLXFBConfig types, 00040 // below. 00041 #include "panda_glxext.h" 00042 00043 // drose: the version of GL/glx.h that ships with Fedora Core 2 seems 00044 // to define GLX_VERSION_1_4, but for some reason does not define 00045 // GLX_SAMPLE_BUFFERS or GLX_SAMPLES. We work around that here. 00046 00047 #ifndef GLX_SAMPLE_BUFFERS 00048 #define GLX_SAMPLE_BUFFERS 100000 00049 #endif 00050 #ifndef GLX_SAMPLES 00051 #define GLX_SAMPLES 100001 00052 #endif 00053 00054 00055 /* 00056 #if !defined(HAVE_GLXFBCONFIG) && defined(GLX_SGIX_fbconfig) && defined(GLX_SGIX_pbuffer) 00057 // If the system glx version isn't 1.3, but these were defined as 00058 // extensions, we can work with that. 00059 #define GLXFBConfig GLXFBConfigSGIX 00060 #define GLXPbuffer GLXPbufferSGIX 00061 #define glXChooseFBConfig glXChooseFBConfigSGIX 00062 #define glXCreateNewContext glXCreateContextWithConfigSGIX 00063 #define glXGetVisualFromFBConfig glXGetVisualFromFBConfigSGIX 00064 #define glXGetFBConfigAttrib glXGetFBConfigAttribSGIX 00065 #define glXDestroyPbuffer glXDestroyGLXPbufferSGIX 00066 00067 #define HAVE_GLXFBCONFIG 00068 #define HAVE_SGI_GLXFBCONFIG 00069 #endif 00070 */ 00071 00072 #endif // CPPPARSER 00073 00074 //////////////////////////////////////////////////////////////////// 00075 // Class : glxGraphicsPipe 00076 // Description : This graphics pipe represents the interface for 00077 // creating OpenGL graphics windows on an X-based 00078 // (e.g. Unix) client. 00079 //////////////////////////////////////////////////////////////////// 00080 class glxGraphicsPipe : public x11GraphicsPipe { 00081 public: 00082 glxGraphicsPipe(const string &display = string()); 00083 virtual ~glxGraphicsPipe() {}; 00084 00085 virtual string get_interface_name() const; 00086 static PT(GraphicsPipe) pipe_constructor(); 00087 00088 protected: 00089 virtual PT(GraphicsOutput) make_output(const string &name, 00090 const FrameBufferProperties &fb_prop, 00091 const WindowProperties &win_prop, 00092 int flags, 00093 GraphicsEngine *engine, 00094 GraphicsStateGuardian *gsg, 00095 GraphicsOutput *host, 00096 int retry, 00097 bool &precertify); 00098 virtual PT(GraphicsStateGuardian) make_callback_gsg(GraphicsEngine *engine); 00099 00100 public: 00101 static TypeHandle get_class_type() { 00102 return _type_handle; 00103 } 00104 static void init_type() { 00105 x11GraphicsPipe::init_type(); 00106 register_type(_type_handle, "glxGraphicsPipe", 00107 x11GraphicsPipe::get_class_type()); 00108 } 00109 virtual TypeHandle get_type() const { 00110 return get_class_type(); 00111 } 00112 virtual TypeHandle force_init_type() {init_type(); return get_class_type();} 00113 00114 private: 00115 static TypeHandle _type_handle; 00116 }; 00117 00118 #include "glxGraphicsPipe.I" 00119 00120 #endif