Panda3D
|
00001 // Filename: config_glxdisplay.cxx 00002 // Created by: cary (07Oct99) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 #include "config_glxdisplay.h" 00016 #include "glxGraphicsBuffer.h" 00017 #include "glxGraphicsPipe.h" 00018 #include "glxGraphicsPixmap.h" 00019 #include "glxGraphicsBuffer.h" 00020 #include "glxGraphicsWindow.h" 00021 #include "glxGraphicsStateGuardian.h" 00022 #include "graphicsPipeSelection.h" 00023 #include "dconfig.h" 00024 #include "pandaSystem.h" 00025 00026 Configure(config_glxdisplay); 00027 NotifyCategoryDef(glxdisplay, "display"); 00028 00029 ConfigureFn(config_glxdisplay) { 00030 init_libglxdisplay(); 00031 } 00032 00033 ConfigVariableBool glx_get_proc_address 00034 ("glx-get-proc-address", true, 00035 PRC_DESC("Set this to true to allow the use of glxGetProcAddress(), if " 00036 "it is available, to query the OpenGL extension functions. This " 00037 "is the standard way to query extension functions.")); 00038 00039 00040 ConfigVariableBool glx_get_os_address 00041 ("glx-get-os-address", true, 00042 PRC_DESC("Set this to true to allow Panda to query the OpenGL library " 00043 "directly using standard operating system calls to locate " 00044 "addresses of extension functions. This will be done only " 00045 "if glxGetProcAddress() cannot be used for some reason.")); 00046 00047 ConfigVariableBool gl_support_fbo 00048 ("gl-support-fbo", true, 00049 PRC_DESC("Configure this false if your GL's implementation of " 00050 "EXT_framebuffer_object is broken. The system might still be " 00051 "able to create buffers using pbuffers or the like.")); 00052 00053 ConfigVariableBool glx_support_fbconfig 00054 ("glx-support-fbconfig", true, 00055 PRC_DESC("Set this true to enable the use of the advanced FBConfig " 00056 "interface (as opposed to the older XVisual interface) " 00057 "if it is available, to select a graphics visual and " 00058 "create an OpenGL context.")); 00059 00060 ConfigVariableBool glx_support_pbuffer 00061 ("glx-support-pbuffer", true, 00062 PRC_DESC("Set this true to enable the use of X pbuffer-based offscreen " 00063 "buffers, if available. This is usually preferred over " 00064 "pixmap-based buffers, but not all drivers support them.")); 00065 00066 ConfigVariableBool glx_support_pixmap 00067 ("glx-support-pixmap", false, 00068 PRC_DESC("Set this true to enable the use of X pixmap-based offscreen " 00069 "buffers. This is false by default because pixmap-based buffers " 00070 "are usually slower than pbuffer-based buffers.")); 00071 00072 00073 //////////////////////////////////////////////////////////////////// 00074 // Function: init_libglxdisplay 00075 // Description: Initializes the library. This must be called at 00076 // least once before any of the functions or classes in 00077 // this library can be used. Normally it will be 00078 // called by the static initializers and need not be 00079 // called explicitly, but special cases exist. 00080 //////////////////////////////////////////////////////////////////// 00081 void 00082 init_libglxdisplay() { 00083 static bool initialized = false; 00084 if (initialized) { 00085 return; 00086 } 00087 initialized = true; 00088 00089 #ifdef HAVE_GLXFBCONFIG 00090 glxGraphicsBuffer::init_type(); 00091 #endif // HAVE_GLXFBCONFIG 00092 glxGraphicsPipe::init_type(); 00093 glxGraphicsPixmap::init_type(); 00094 glxGraphicsBuffer::init_type(); 00095 glxGraphicsWindow::init_type(); 00096 glxGraphicsStateGuardian::init_type(); 00097 00098 GraphicsPipeSelection *selection = GraphicsPipeSelection::get_global_ptr(); 00099 selection->add_pipe_type(glxGraphicsPipe::get_class_type(), 00100 glxGraphicsPipe::pipe_constructor); 00101 00102 PandaSystem *ps = PandaSystem::get_global_ptr(); 00103 ps->set_system_tag("OpenGL", "window_system", "GLX"); 00104 }