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