Panda3D

Loading...
Searching...
No Matches
config_wgldisplay.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_wgldisplay.cxx
10 * @author drose
11 * @date 2002-12-20
12 */
13
14#include "config_wgldisplay.h"
15#include "wglGraphicsBuffer.h"
16#include "wglGraphicsPipe.h"
17#include "wglGraphicsStateGuardian.h"
18#include "wglGraphicsWindow.h"
19#include "graphicsPipeSelection.h"
20#include "dconfig.h"
21#include "pandaSystem.h"
22
23#if !defined(CPPPARSER) && !defined(LINK_ALL_STATIC) && !defined(BUILDING_PANDA_WGLDISPLAY)
24 #error Buildsystem error: BUILDING_PANDA_WGLDISPLAY not defined
25#endif
26
27Configure(config_wgldisplay);
28NotifyCategoryDef(wgldisplay, "display");
29
30ConfigureFn(config_wgldisplay) {
31 init_libwgldisplay();
32}
33
34 ConfigVariableInt gl_force_pixfmt
35("gl-force-pixfmt", 0);
36
37 ConfigVariableBool gl_force_invalid
38("gl-force-invalid", false,
39 PRC_DESC("Set this true to force all GL windows to fail to open "
40 "correctly (for debugging)."));
41
42 ConfigVariableBool gl_do_vidmemsize_check
43("gl-do-vidmemsize-check", true,
44 PRC_DESC("This is true to insist that low-memory cards open only 640x480 "
45 "fullscreen windows, no matter what resolution of window was "
46 "requested. It only affects fullscreen windows."));
47
48/**
49 * Initializes the library. This must be called at least once before any of
50 * the functions or classes in this library can be used. Normally it will be
51 * called by the static initializers and need not be called explicitly, but
52 * special cases exist.
53 */
54 void
55 init_libwgldisplay() {
56 static bool initialized = false;
57 if (initialized) {
58 return;
59 }
60 initialized = true;
61
62 wglGraphicsBuffer::init_type();
63 wglGraphicsPipe::init_type();
64 wglGraphicsStateGuardian::init_type();
65 wglGraphicsWindow::init_type();
66
67 GraphicsPipeSelection *selection = GraphicsPipeSelection::get_global_ptr();
68 selection->add_pipe_type(wglGraphicsPipe::get_class_type(),
69 wglGraphicsPipe::pipe_constructor);
70
71 PandaSystem *ps = PandaSystem::get_global_ptr();
72 ps->set_system_tag("OpenGL", "window_system", "WGL");
73}
ConfigVariableBool
This is a convenience class to specialize ConfigVariable as a boolean type.
Definition configVariableBool.h:23
ConfigVariableInt
This is a convenience class to specialize ConfigVariable as an integer type.
Definition configVariableInt.h:24
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_libwgldisplay
void init_libwgldisplay()
Initializes the library.
Definition config_wgldisplay.cxx:55
config_wgldisplay.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
dconfig.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.
wglGraphicsBuffer.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
wglGraphicsPipe.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
wglGraphicsStateGuardian.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
wglGraphicsWindow.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.