Panda3D
 All Classes Functions Variables Enumerations
config_wgldisplay.cxx
1 // Filename: config_wgldisplay.cxx
2 // Created by: drose (20Dec02)
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 #include "config_wgldisplay.h"
16 #include "wglGraphicsBuffer.h"
17 #include "wglGraphicsPipe.h"
18 #include "wglGraphicsStateGuardian.h"
19 #include "wglGraphicsWindow.h"
20 #include "graphicsPipeSelection.h"
21 #include "dconfig.h"
22 #include "pandaSystem.h"
23 
24 Configure(config_wgldisplay);
25 NotifyCategoryDef(wgldisplay, "display");
26 
27 ConfigureFn(config_wgldisplay) {
28  init_libwgldisplay();
29 }
30 
31 ConfigVariableInt gl_force_pixfmt
32 ("gl-force-pixfmt", 0);
33 
34 ConfigVariableBool gl_force_invalid
35 ("gl-force-invalid", false,
36  PRC_DESC("Set this true to force all GL windows to fail to open "
37  "correctly (for debugging)."));
38 
39 ConfigVariableBool gl_do_vidmemsize_check
40 ("gl-do-vidmemsize-check", true,
41  PRC_DESC("This is true to insist that low-memory cards open only 640x480 "
42  "fullscreen windows, no matter what resolution of window was "
43  "requested. It only affects fullscreen windows."));
44 
45 ////////////////////////////////////////////////////////////////////
46 // Function: init_libwgldisplay
47 // Description: Initializes the library. This must be called at
48 // least once before any of the functions or classes in
49 // this library can be used. Normally it will be
50 // called by the static initializers and need not be
51 // called explicitly, but special cases exist.
52 ////////////////////////////////////////////////////////////////////
53 void
54 init_libwgldisplay() {
55  static bool initialized = false;
56  if (initialized) {
57  return;
58  }
59  initialized = true;
60 
61  wglGraphicsBuffer::init_type();
62  wglGraphicsPipe::init_type();
63  wglGraphicsStateGuardian::init_type();
64  wglGraphicsWindow::init_type();
65 
67  selection->add_pipe_type(wglGraphicsPipe::get_class_type(),
68  wglGraphicsPipe::pipe_constructor);
69 
71  ps->set_system_tag("OpenGL", "window_system", "WGL");
72 }
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:29
This is a convenience class to specialize ConfigVariable as a boolean type.
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.
bool add_pipe_type(TypeHandle type, PipeConstructorFunc *func)
Adds a new kind of GraphicsPipe to the list of available pipes for creation.
This is a convenience class to specialize ConfigVariable as an integer type.
void set_system_tag(const string &system, const string &tag, const string &value)
Intended for use by each subsystem to register its set of capabilities at startup.