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 "posixGraphicsStateGuardian.h" 00023 #include "graphicsPipeSelection.h" 00024 #include "dconfig.h" 00025 #include "pandaSystem.h" 00026 00027 Configure(config_glxdisplay); 00028 NotifyCategoryDef(glxdisplay, "display"); 00029 00030 ConfigureFn(config_glxdisplay) { 00031 init_libglxdisplay(); 00032 } 00033 00034 ConfigVariableBool glx_get_proc_address 00035 ("glx-get-proc-address", true, 00036 PRC_DESC("Set this to true to allow the use of glxGetProcAddress(), if " 00037 "it is available, to query the OpenGL extension functions. This " 00038 "is the standard way to query extension functions.")); 00039 00040 00041 ConfigVariableBool glx_get_os_address 00042 ("glx-get-os-address", true, 00043 PRC_DESC("Set this to true to allow Panda to query the OpenGL library " 00044 "directly using standard operating system calls to locate " 00045 "addresses of extension functions. This will be done only " 00046 "if glxGetProcAddress() cannot be used for some reason.")); 00047 00048 ConfigVariableBool gl_support_fbo 00049 ("gl-support-fbo", true, 00050 PRC_DESC("Configure this false if your GL's implementation of " 00051 "EXT_framebuffer_object is broken. The system might still be " 00052 "able to create buffers using pbuffers or the like.")); 00053 00054 ConfigVariableBool glx_support_fbconfig 00055 ("glx-support-fbconfig", true, 00056 PRC_DESC("Set this true to enable the use of the advanced FBConfig " 00057 "interface (as opposed to the older XVisual interface) " 00058 "if it is available, to select a graphics visual and " 00059 "create an OpenGL context.")); 00060 00061 ConfigVariableBool glx_support_pbuffer 00062 ("glx-support-pbuffer", true, 00063 PRC_DESC("Set this true to enable the use of X pbuffer-based offscreen " 00064 "buffers, if available. This is usually preferred over " 00065 "pixmap-based buffers, but not all drivers support them.")); 00066 00067 ConfigVariableBool glx_support_pixmap 00068 ("glx-support-pixmap", false, 00069 PRC_DESC("Set this true to enable the use of X pixmap-based offscreen " 00070 "buffers. This is false by default because pixmap-based buffers " 00071 "are usually slower than pbuffer-based buffers.")); 00072 00073 00074 //////////////////////////////////////////////////////////////////// 00075 // Function: init_libglxdisplay 00076 // Description: Initializes the library. This must be called at 00077 // least once before any of the functions or classes in 00078 // this library can be used. Normally it will be 00079 // called by the static initializers and need not be 00080 // called explicitly, but special cases exist. 00081 //////////////////////////////////////////////////////////////////// 00082 void 00083 init_libglxdisplay() { 00084 static bool initialized = false; 00085 if (initialized) { 00086 return; 00087 } 00088 initialized = true; 00089 00090 #ifdef HAVE_GLXFBCONFIG 00091 glxGraphicsBuffer::init_type(); 00092 #endif // HAVE_GLXFBCONFIG 00093 glxGraphicsPipe::init_type(); 00094 glxGraphicsPixmap::init_type(); 00095 glxGraphicsBuffer::init_type(); 00096 glxGraphicsWindow::init_type(); 00097 glxGraphicsStateGuardian::init_type(); 00098 PosixGraphicsStateGuardian::init_type(); 00099 00100 GraphicsPipeSelection *selection = GraphicsPipeSelection::get_global_ptr(); 00101 selection->add_pipe_type(glxGraphicsPipe::get_class_type(), 00102 glxGraphicsPipe::pipe_constructor); 00103 00104 PandaSystem *ps = PandaSystem::get_global_ptr(); 00105 ps->set_system_tag("OpenGL", "window_system", "GLX"); 00106 }