Panda3D
|
00001 // Filename: config_grutil.cxx 00002 // Created by: drose (24May00) 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_grutil.h" 00016 #include "frameRateMeter.h" 00017 #include "sceneGraphAnalyzerMeter.h" 00018 #include "meshDrawer.h" 00019 #include "meshDrawer2D.h" 00020 #include "geoMipTerrain.h" 00021 #include "movieTexture.h" 00022 #include "pandaSystem.h" 00023 #include "texturePool.h" 00024 #include "nodeVertexTransform.h" 00025 #include "rigidBodyCombiner.h" 00026 #include "pipeOcclusionCullTraverser.h" 00027 00028 #include "dconfig.h" 00029 00030 Configure(config_grutil); 00031 NotifyCategoryDef(grutil, ""); 00032 00033 ConfigureFn(config_grutil) { 00034 init_libgrutil(); 00035 } 00036 00037 ConfigVariableDouble frame_rate_meter_update_interval 00038 ("frame-rate-meter-update-interval", 1.5); 00039 00040 ConfigVariableString frame_rate_meter_text_pattern 00041 ("frame-rate-meter-text-pattern", "%0.1f fps"); 00042 00043 ConfigVariableInt frame_rate_meter_layer_sort 00044 ("frame-rate-meter-layer-sort", 1000); 00045 00046 ConfigVariableDouble frame_rate_meter_scale 00047 ("frame-rate-meter-scale", 0.05); 00048 00049 ConfigVariableDouble frame_rate_meter_side_margins 00050 ("frame-rate-meter-side-margins", 0.5); 00051 00052 ConfigVariableDouble scene_graph_analyzer_meter_update_interval 00053 ("scene-graph-analyzer-meter-update-interval", 2.0); 00054 00055 ConfigVariableInt scene_graph_analyzer_meter_layer_sort 00056 ("scene-graph-analyzer-meter-layer-sort", 1000); 00057 00058 ConfigVariableDouble scene_graph_analyzer_meter_scale 00059 ("scene-graph-analyzer-meter-scale", 0.05); 00060 00061 ConfigVariableDouble scene_graph_analyzer_meter_side_margins 00062 ("scene-graph-analyzer-meter-side-margins", 0.5); 00063 00064 ConfigVariableBool pfm_force_littleendian 00065 ("pfm-force-littleendian", false, 00066 PRC_DESC("This forces a pfm file to be read as a sequence of little-endian " 00067 "floats, even if its scale factor is given as a positive number.")); 00068 00069 ConfigVariableBool pfm_reverse_dimensions 00070 ("pfm-reverse-dimensions", false, 00071 PRC_DESC("Understands that the width and height of a pfm file are given " 00072 "backwards, in the form height width instead of width height, " 00073 "on input. Does not affect output, which is always written width height.")); 00074 00075 ConfigVariableInt pfm_vis_max_vertices 00076 ("pfm-vis-max-vertices", 65535, 00077 PRC_DESC("Specifies the maximum number of vertex entries that may appear in " 00078 "a single generated mesh. If the mesh would require more than that, " 00079 "the mesh is subdivided into smaller pieces.")); 00080 00081 ConfigVariableInt pfm_vis_max_indices 00082 ("pfm-vis-max-indices", 1048576, 00083 PRC_DESC("Specifies the maximum number of vertex references that may appear in " 00084 "a single generated mesh. If the mesh would require more than that, " 00085 "the mesh is subdivided into smaller pieces.")); 00086 00087 ConfigVariableBool movies_sync_pages 00088 ("movies-sync-pages", true, 00089 PRC_DESC("Set this true to force multi-page MovieTextures to hold pages " 00090 "back if necessary until all pages are ready to render at once, " 00091 "so that the multiple pages of a single movie are always in sync " 00092 "with each other. Set this false to allow individual pages to be " 00093 "visible as soon as they come available, which means pages might " 00094 "sometimes be out of sync. This only affects multi-page MovieTextures " 00095 "such as cube maps, 3-d textures, or stereo textures, or textures " 00096 "with separate color and alpha channel movie sources.")); 00097 00098 //////////////////////////////////////////////////////////////////// 00099 // Function: init_libgrutil 00100 // Description: Initializes the library. This must be called at 00101 // least once before any of the functions or classes in 00102 // this library can be used. Normally it will be 00103 // called by the static initializers and need not be 00104 // called explicitly, but special cases exist. 00105 //////////////////////////////////////////////////////////////////// 00106 void 00107 init_libgrutil() { 00108 static bool initialized = false; 00109 if (initialized) { 00110 return; 00111 } 00112 initialized = true; 00113 00114 FrameRateMeter::init_type(); 00115 MeshDrawer::init_type(); 00116 MeshDrawer2D::init_type(); 00117 GeoMipTerrain::init_type(); 00118 NodeVertexTransform::init_type(); 00119 RigidBodyCombiner::init_type(); 00120 PipeOcclusionCullTraverser::init_type(); 00121 SceneGraphAnalyzerMeter::init_type(); 00122 00123 #ifdef HAVE_AUDIO 00124 MovieTexture::init_type(); 00125 MovieTexture::register_with_read_factory(); 00126 #endif // HAVE_AUDIO 00127 00128 #ifdef HAVE_FFMPEG 00129 MovieTexture::init_type(); 00130 MovieTexture::register_with_read_factory(); 00131 00132 TexturePool *ts = TexturePool::get_global_ptr(); 00133 ts->register_texture_type(MovieTexture::make_texture, "avi mov mpg mpeg mp4 wmv asf flv nut ogm mkv"); 00134 #endif // HAVE_FFMPEG 00135 } 00136