Panda3D
 All Classes Functions Variables Enumerations
config_osxdisplay.cxx
1 ////////////////////////////////////////////////////////////////////
2 //
3 // PANDA 3D SOFTWARE
4 // Copyright (c) Carnegie Mellon University. All rights reserved.
5 //
6 // All use of this software is subject to the terms of the revised BSD
7 // license. You should have received a copy of this license along
8 // with this source code in a file named "LICENSE."
9 //
10 ////////////////////////////////////////////////////////////////////
11 #include <Carbon/Carbon.h>
12 
13 #include "config_osxdisplay.h"
14 #include "osxGraphicsBuffer.h"
15 #include "osxGraphicsPipe.h"
16 #include "osxGraphicsStateGuardian.h"
17 #include "osxGraphicsWindow.h"
18 
19 #include "graphicsPipeSelection.h"
20 #include "dconfig.h"
21 #include "pandaSystem.h"
22 
23 
24 Configure(config_osxdisplay);
25 
26 NotifyCategoryDef(osxdisplay, "display");
27 
28 ConfigureFn(config_osxdisplay) {
29  init_libosxdisplay();
30 }
31 
32 ConfigVariableBool show_resize_box
33 ("show-resize-box", true,
34  PRC_DESC("When this variable is true, then resizable OSX Panda windows will "
35  "be rendered with a resize control in the lower-right corner. "
36  "This is specially handled by Panda, since otherwise the 3-d "
37  "window would completely hide any resize control drawn by the "
38  "OS. Set this variable false to allow this control to be hidden."));
39 
40 ConfigVariableBool osx_support_gl_buffer
41 ("osx-support-gl-buffer", true,
42  PRC_DESC("Set this true to support use of GLBuffers on OSX. When true, there is a risk of "
43  "a program crash due to buggy driver support for GLBuffers. "
44  "If this is false, offscreen buffers will be created as "
45  "AGLPbuffers, which are less powerful, and appear to have their "
46  "own set of problems."));
47 
48 ConfigVariableBool osx_disable_event_loop
49 ("osx-disable-event-loop", false,
50  PRC_DESC("Set this true to disable the window event loop for the Panda "
51  "windows. This makes sense only in a publish environment where "
52  "the window event loop is already handled by another part of the "
53  "app."));
54 
55 ConfigVariableInt osx_mouse_wheel_scale
56 ("osx-mouse-wheel-scale", 1,
57  PRC_DESC("Specify the number of units to spin the Mac mouse wheel to "
58  "represent a single wheel_up or wheel_down message."));
59 
60 ////////////////////////////////////////////////////////////////////
61 // Function: init_libosxdisplay
62 // Description: Initializes the library. This must be called at
63 // least once before any of the functions or classes in
64 // this library can be used. Normally it will be
65 // called by the static initializers and need not be
66 // called explicitly, but special cases exist.
67 ////////////////////////////////////////////////////////////////////
68 void
69 init_libosxdisplay() {
70  static bool initialized = false;
71  if (initialized) {
72  return;
73  }
74  initialized = true;
75 
76  osxGraphicsBuffer::init_type();
77  osxGraphicsPipe::init_type();
78  osxGraphicsWindow::init_type();
79  osxGraphicsStateGuardian::init_type();
80 
82  selection->add_pipe_type(osxGraphicsPipe::get_class_type(), osxGraphicsPipe::pipe_constructor);
83 
85  ps->set_system_tag("OpenGL", "window_system", "OSX");
86 }
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.