Panda3D
 All Classes Functions Variables Enumerations
glxGraphicsPipe.h
1 // Filename: glxGraphicsPipe.h
2 // Created by: mike (09Jan97)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef GLXGRAPHICSPIPE_H
16 #define GLXGRAPHICSPIPE_H
17 
18 #include "pandabase.h"
19 #include "graphicsWindow.h"
20 #include "graphicsPipe.h"
21 #include "glgsg.h"
22 #include "lightMutex.h"
23 #include "lightReMutex.h"
24 #include "x11GraphicsPipe.h"
25 
27 
28 #ifndef CPPPARSER
29 
30 // Don't pick up the system glxext.h; use our own, which is better.
31 #define __glxext_h_
32 
33 #include "pre_x11_include.h"
34 #include <GL/glx.h>
35 #include "post_x11_include.h"
36 
37 // This must be included after we have included glgsg.h (which
38 // includes gl.h), and after we have checked GLX_VERSION_1_3. But we
39 // must also include it before we redefine the GLXFBConfig types,
40 // below.
41 #include "panda_glxext.h"
42 
43 // drose: the version of GL/glx.h that ships with Fedora Core 2 seems
44 // to define GLX_VERSION_1_4, but for some reason does not define
45 // GLX_SAMPLE_BUFFERS or GLX_SAMPLES. We work around that here.
46 
47 #ifndef GLX_SAMPLE_BUFFERS
48 #define GLX_SAMPLE_BUFFERS 100000
49 #endif
50 #ifndef GLX_SAMPLES
51 #define GLX_SAMPLES 100001
52 #endif
53 
54 
55 /*
56 #if !defined(HAVE_GLXFBCONFIG) && defined(GLX_SGIX_fbconfig) && defined(GLX_SGIX_pbuffer)
57  // If the system glx version isn't 1.3, but these were defined as
58  // extensions, we can work with that.
59  #define GLXFBConfig GLXFBConfigSGIX
60  #define GLXPbuffer GLXPbufferSGIX
61  #define glXChooseFBConfig glXChooseFBConfigSGIX
62  #define glXCreateNewContext glXCreateContextWithConfigSGIX
63  #define glXGetVisualFromFBConfig glXGetVisualFromFBConfigSGIX
64  #define glXGetFBConfigAttrib glXGetFBConfigAttribSGIX
65  #define glXDestroyPbuffer glXDestroyGLXPbufferSGIX
66 
67  #define HAVE_GLXFBCONFIG
68  #define HAVE_SGI_GLXFBCONFIG
69 #endif
70 */
71 
72 #endif // CPPPARSER
73 
74 ////////////////////////////////////////////////////////////////////
75 // Class : glxGraphicsPipe
76 // Description : This graphics pipe represents the interface for
77 // creating OpenGL graphics windows on an X-based
78 // (e.g. Unix) client.
79 ////////////////////////////////////////////////////////////////////
81 public:
82  glxGraphicsPipe(const string &display = string());
83  virtual ~glxGraphicsPipe() {};
84 
85  virtual string get_interface_name() const;
86  static PT(GraphicsPipe) pipe_constructor();
87 
88 protected:
89  virtual PT(GraphicsOutput) make_output(const string &name,
90  const FrameBufferProperties &fb_prop,
91  const WindowProperties &win_prop,
92  int flags,
93  GraphicsEngine *engine,
95  GraphicsOutput *host,
96  int retry,
97  bool &precertify);
98  virtual PT(GraphicsStateGuardian) make_callback_gsg(GraphicsEngine *engine);
99 
100 public:
101  static TypeHandle get_class_type() {
102  return _type_handle;
103  }
104  static void init_type() {
105  x11GraphicsPipe::init_type();
106  register_type(_type_handle, "glxGraphicsPipe",
107  x11GraphicsPipe::get_class_type());
108  }
109  virtual TypeHandle get_type() const {
110  return get_class_type();
111  }
112  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
113 
114 private:
115  static TypeHandle _type_handle;
116 };
117 
118 #include "glxGraphicsPipe.I"
119 
120 #endif
This graphics pipe represents the interface for creating OpenGL graphics windows on an X-based (e...
This graphics pipe represents the interface for creating graphics windows on an X-based client...
virtual string get_interface_name() const
Returns the name of the rendering interface associated with this GraphicsPipe.
A container for the various kinds of properties we might ask to have on a graphics window before we o...
An object to create GraphicsOutputs that share a particular 3-D API.
Definition: graphicsPipe.h:58
This is a base class for the various different classes that represent the result of a frame of render...
Encapsulates all the communication with a particular instance of a given rendering backend...
This class is the main interface to controlling the render process.
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85
A container for the various kinds of properties we might ask to have on a graphics frameBuffer before...