Panda3D

Loading...
Searching...
No Matches
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"
20#include "glxGraphicsStateGuardian.h"
21#include "posixGraphicsStateGuardian.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
30Configure(config_glxdisplay);
31NotifyCategoryDef(glxdisplay, "display");
32
33ConfigureFn(config_glxdisplay) {
34 init_libglxdisplay();
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
78 init_libglxdisplay() {
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
95 GraphicsPipeSelection *selection = GraphicsPipeSelection::get_global_ptr();
96 selection->add_pipe_type(glxGraphicsPipe::get_class_type(),
97 glxGraphicsPipe::pipe_constructor);
98
99 PandaSystem *ps = PandaSystem::get_global_ptr();
100 ps->set_system_tag("OpenGL", "window_system", "GLX");
101}
ConfigVariableBool
This is a convenience class to specialize ConfigVariable as a boolean type.
Definition configVariableBool.h:23
GraphicsPipeSelection
This maintains a list of GraphicsPipes by type that are available for creation.
Definition graphicsPipeSelection.h:33
GraphicsPipeSelection::get_global_ptr
static GraphicsPipeSelection * get_global_ptr()
Returns a pointer to the one global GraphicsPipeSelection object.
Definition graphicsPipeSelection.I:28
GraphicsPipeSelection::add_pipe_type
bool add_pipe_type(TypeHandle type, PipeConstructorFunc *func)
Adds a new kind of GraphicsPipe to the list of available pipes for creation.
Definition graphicsPipeSelection.cxx:317
PandaSystem
This class is used as a namespace to group several global properties of Panda.
Definition pandaSystem.h:26
PandaSystem::set_system_tag
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.
Definition pandaSystem.cxx:383
PandaSystem::get_global_ptr
static PandaSystem * get_global_ptr()
Returns the global PandaSystem object.
Definition pandaSystem.cxx:448
init_libglxdisplay
void init_libglxdisplay()
Initializes the library.
Definition config_glxdisplay.cxx:78
config_glxdisplay.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
dconfig.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
glxGraphicsBuffer.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
glxGraphicsPipe.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
glxGraphicsPixmap.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
glxGraphicsStateGuardian.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
glxGraphicsWindow.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
graphicsPipeSelection.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pandaSystem.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
posixGraphicsStateGuardian.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.