Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

panda/src/wcrdisplay/config_wcrdisplay.cxx

Go to the documentation of this file.
00001 // Filename: config_wcrdisplay.cxx
00002 // Created by:  skyler, based on wgl* file.
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) 2001, Disney Enterprises, Inc.  All rights reserved
00008 //
00009 // All use of this software is subject to the terms of the Panda 3d
00010 // Software license.  You should have received a copy of this license
00011 // along with this source code; you will also find a current copy of
00012 // the license at http://www.panda3d.org/license.txt .
00013 //
00014 // To contact the maintainers of this program write to
00015 // panda3d@yahoogroups.com .
00016 //
00017 ////////////////////////////////////////////////////////////////////
00018 
00019 #include "config_wcrdisplay.h"
00020 #include "wcrGraphicsPipe.h"
00021 #include "wcrGraphicsWindow.h"
00022 
00023 #include <dconfig.h>
00024 
00025 Configure(config_wcrdisplay);
00026 NotifyCategoryDef(wcrdisplay, "display");
00027 
00028 ConfigureFn(config_wcrdisplay) {
00029   init_libwcrdisplay();
00030 }
00031 
00032 //  Configure this true to force the rendering to sync to the video
00033 //  refresh, or false to let your frame rate go as high as it can,
00034 //  irrespective of the video refresh.  (if this capability is available in the ICD)
00035 bool gl_sync_video = config_wcrdisplay.GetBool("sync-video", true);
00036 
00037 bool gl_show_fps_meter = config_wcrdisplay.GetBool("show-fps-meter", false);
00038 float gl_fps_meter_update_interval = max(0.5,config_wcrdisplay.GetFloat("fps-meter-update-interval", 1.7));
00039 int gl_forced_pixfmt=config_wcrdisplay.GetInt("gl-force-pixfmt", 0);
00040 
00041 bool bResponsive_minimized_fullscreen_window = config_wcrdisplay.GetBool("responsive-minimized-fullscreen-window",false);
00042 
00043 // Set this true to not attempt to use any of the function calls that
00044 // will crab out WireGL.
00045 bool support_wiregl = config_wcrdisplay.GetBool("support-wiregl", false);
00046 
00047 extern void AtExitFn();
00048 
00049 ////////////////////////////////////////////////////////////////////
00050 //     Function: init_libwcrdisplay
00051 //  Description: Initializes the library.  This must be called at
00052 //               least once before any of the functions or classes in
00053 //               this library can be used.  Normally it will be
00054 //               called by the static initializers and need not be
00055 //               called explicitly, but special cases exist.
00056 ////////////////////////////////////////////////////////////////////
00057 void
00058 init_libwcrdisplay() {
00059   static bool initialized = false;
00060   if (initialized) {
00061     return;
00062   }
00063   initialized = true;
00064 
00065   wcrGraphicsPipe::init_type();
00066   GraphicsPipe::get_factory().register_factory(
00067             wcrGraphicsPipe::get_class_type(),
00068             wcrGraphicsPipe::make_wcrGraphicsPipe);
00069   wcrGraphicsWindow::init_type();
00070   GraphicsWindow::get_factory().register_factory(
00071             wcrGraphicsWindow::get_class_type(),
00072                 wcrGraphicsWindow::make_wcrGraphicsWindow);
00073 
00074   atexit(AtExitFn);
00075 }
00076 
00077 // cant use global var cleanly because global var static init executed after init_libwcr(), incorrectly reiniting var
00078 Filename get_icon_filename_2() {
00079   string iconname = config_wcrdisplay.GetString("win32-window-icon","");
00080   return ExecutionEnvironment::expand_string(iconname);
00081 }
00082 
00083 Filename get_color_cursor_filename_2() {
00084   string cursorname = config_wcrdisplay.GetString("win32-color-cursor","");
00085   return ExecutionEnvironment::expand_string(cursorname);
00086 }
00087 
00088 Filename get_mono_cursor_filename_2() {
00089   string cursorname = config_wcrdisplay.GetString("win32-mono-cursor","");
00090   return ExecutionEnvironment::expand_string(cursorname);
00091 }

Generated on Fri May 2 00:44:39 2003 for Panda by doxygen1.3