Panda3D
config_glxdisplay.cxx
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 config_glxdisplay.cxx
10  * @author cary
11  * @date 1999-10-07
12  */
13 
14 #include "config_glxdisplay.h"
15 #include "glxGraphicsBuffer.h"
16 #include "glxGraphicsPipe.h"
17 #include "glxGraphicsPixmap.h"
18 #include "glxGraphicsBuffer.h"
19 #include "glxGraphicsWindow.h"
22 #include "graphicsPipeSelection.h"
23 #include "dconfig.h"
24 #include "pandaSystem.h"
25 
26 #if !defined(CPPPARSER) && !defined(LINK_ALL_STATIC) && !defined(BUILDING_PANDA_GLXDISPLAY)
27  #error Buildsystem error: BUILDING_PANDA_GLXDISPLAY not defined
28 #endif
29 
30 Configure(config_glxdisplay);
31 NotifyCategoryDef(glxdisplay, "display");
32 
33 ConfigureFn(config_glxdisplay) {
35 }
36 
37 ConfigVariableBool glx_get_proc_address
38 ("glx-get-proc-address", true,
39  PRC_DESC("Set this to true to allow the use of glxGetProcAddress(), if "
40  "it is available, to query the OpenGL extension functions. This "
41  "is the standard way to query extension functions."));
42 
43 
44 ConfigVariableBool glx_get_os_address
45 ("glx-get-os-address", true,
46  PRC_DESC("Set this to true to allow Panda to query the OpenGL library "
47  "directly using standard operating system calls to locate "
48  "addresses of extension functions. This will be done only "
49  "if glxGetProcAddress() cannot be used for some reason."));
50 
51 ConfigVariableBool glx_support_fbconfig
52 ("glx-support-fbconfig", true,
53  PRC_DESC("Set this true to enable the use of the advanced FBConfig "
54  "interface (as opposed to the older XVisual interface) "
55  "if it is available, to select a graphics visual and "
56  "create an OpenGL context."));
57 
58 ConfigVariableBool glx_support_pbuffer
59 ("glx-support-pbuffer", true,
60  PRC_DESC("Set this true to enable the use of X pbuffer-based offscreen "
61  "buffers, if available. This is usually preferred over "
62  "pixmap-based buffers, but not all drivers support them."));
63 
64 ConfigVariableBool glx_support_pixmap
65 ("glx-support-pixmap", false,
66  PRC_DESC("Set this true to enable the use of X pixmap-based offscreen "
67  "buffers. This is false by default because pixmap-based buffers "
68  "are usually slower than pbuffer-based buffers."));
69 
70 
71 /**
72  * Initializes the library. This must be called at least once before any of
73  * the functions or classes in this library can be used. Normally it will be
74  * called by the static initializers and need not be called explicitly, but
75  * special cases exist.
76  */
77 void
79  static bool initialized = false;
80  if (initialized) {
81  return;
82  }
83  initialized = true;
84 
85 #ifdef HAVE_GLXFBCONFIG
86  glxGraphicsBuffer::init_type();
87 #endif // HAVE_GLXFBCONFIG
88  glxGraphicsPipe::init_type();
89  glxGraphicsPixmap::init_type();
90  glxGraphicsBuffer::init_type();
91  glxGraphicsWindow::init_type();
92  glxGraphicsStateGuardian::init_type();
93  PosixGraphicsStateGuardian::init_type();
94 
96  selection->add_pipe_type(glxGraphicsPipe::get_class_type(),
97  glxGraphicsPipe::pipe_constructor);
98 
100  ps->set_system_tag("OpenGL", "window_system", "GLX");
101 }
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
static PandaSystem * get_global_ptr()
Returns the global PandaSystem object.
This class is used as a namespace to group several global properties of Panda.
Definition: pandaSystem.h:26
This is a convenience class to specialize ConfigVariable as a boolean type.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This maintains a list of GraphicsPipes by type that are available for creation.
static GraphicsPipeSelection * get_global_ptr()
Returns a pointer to the one global GraphicsPipeSelection object.
void set_system_tag(const std::string &system, const std::string &tag, const std::string &value)
Intended for use by each subsystem to register its set of capabilities at startup.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
bool add_pipe_type(TypeHandle type, PipeConstructorFunc *func)
Adds a new kind of GraphicsPipe to the list of available pipes for creation.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void init_libglxdisplay()
Initializes the library.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.