Panda3D
 All Classes Functions Variables Enumerations
config_grutil.cxx
1 // Filename: config_grutil.cxx
2 // Created by: drose (24May00)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #include "config_grutil.h"
16 #include "frameRateMeter.h"
17 #include "sceneGraphAnalyzerMeter.h"
18 #include "meshDrawer.h"
19 #include "meshDrawer2D.h"
20 #include "geoMipTerrain.h"
21 #include "movieTexture.h"
22 #include "pandaSystem.h"
23 #include "texturePool.h"
24 #include "nodeVertexTransform.h"
25 #include "rigidBodyCombiner.h"
26 #include "pipeOcclusionCullTraverser.h"
27 
28 #include "dconfig.h"
29 
30 Configure(config_grutil);
31 NotifyCategoryDef(grutil, "");
32 
33 ConfigureFn(config_grutil) {
34  init_libgrutil();
35 }
36 
37 ConfigVariableBool frame_rate_meter_milliseconds
38 ("frame-rate-meter-milliseconds", false);
39 
40 ConfigVariableDouble frame_rate_meter_update_interval
41 ("frame-rate-meter-update-interval", 1.5);
42 
43 ConfigVariableString frame_rate_meter_text_pattern
44 ("frame-rate-meter-text-pattern", "%0.1f fps");
45 
46 ConfigVariableString frame_rate_meter_ms_text_pattern
47 ("frame-rate-meter-ms-text-pattern", "%0.1f ms");
48 
49 ConfigVariableInt frame_rate_meter_layer_sort
50 ("frame-rate-meter-layer-sort", 1000);
51 
52 ConfigVariableDouble frame_rate_meter_scale
53 ("frame-rate-meter-scale", 0.05);
54 
55 ConfigVariableDouble frame_rate_meter_side_margins
56 ("frame-rate-meter-side-margins", 0.5);
57 
58 ConfigVariableDouble scene_graph_analyzer_meter_update_interval
59 ("scene-graph-analyzer-meter-update-interval", 2.0);
60 
61 ConfigVariableInt scene_graph_analyzer_meter_layer_sort
62 ("scene-graph-analyzer-meter-layer-sort", 1000);
63 
64 ConfigVariableDouble scene_graph_analyzer_meter_scale
65 ("scene-graph-analyzer-meter-scale", 0.05);
66 
67 ConfigVariableDouble scene_graph_analyzer_meter_side_margins
68 ("scene-graph-analyzer-meter-side-margins", 0.5);
69 
70 ConfigVariableBool movies_sync_pages
71 ("movies-sync-pages", true,
72  PRC_DESC("Set this true to force multi-page MovieTextures to hold pages "
73  "back if necessary until all pages are ready to render at once, "
74  "so that the multiple pages of a single movie are always in sync "
75  "with each other. Set this false to allow individual pages to be "
76  "visible as soon as they come available, which means pages might "
77  "sometimes be out of sync. This only affects multi-page MovieTextures "
78  "such as cube maps, 3-d textures, or stereo textures, or textures "
79  "with separate color and alpha channel movie sources."));
80 
81 ConfigVariableInt pfm_vis_max_vertices
82 ("pfm-vis-max-vertices", 65535,
83  PRC_DESC("Specifies the maximum number of vertex entries that may appear in "
84  "a single generated mesh. If the mesh would require more than that, "
85  "the mesh is subdivided into smaller pieces."));
86 
87 ConfigVariableInt pfm_vis_max_indices
88 ("pfm-vis-max-indices", 1048576,
89  PRC_DESC("Specifies the maximum number of vertex references that may appear in "
90  "a single generated mesh. If the mesh would require more than that, "
91  "the mesh is subdivided into smaller pieces."));
92 
93 ConfigVariableDouble ae_undershift_factor_16
94 ("ae-undershift-factor-16", 1.004,
95  PRC_DESC("Specifies the factor by which After Effects under-applies the specified "
96  "maximum pixel shift when applying a displacement map, in a 16-bit project file. This is used "
97  "to control PfmVizzer::make_displacement()."));
98 
99 ConfigVariableDouble ae_undershift_factor_32
100 ("ae-undershift-factor-32", 1.0,
101  PRC_DESC("Specifies the factor by which After Effects under-applies the specified "
102  "maximum pixel shift when applying a displacement map, in a 32-bit project file. This is used "
103  "to control PfmVizzer::make_displacement()."));
104 
105 ////////////////////////////////////////////////////////////////////
106 // Function: init_libgrutil
107 // Description: Initializes the library. This must be called at
108 // least once before any of the functions or classes in
109 // this library can be used. Normally it will be
110 // called by the static initializers and need not be
111 // called explicitly, but special cases exist.
112 ////////////////////////////////////////////////////////////////////
113 void
114 init_libgrutil() {
115  static bool initialized = false;
116  if (initialized) {
117  return;
118  }
119  initialized = true;
120 
121  FrameRateMeter::init_type();
122  MeshDrawer::init_type();
123  MeshDrawer2D::init_type();
124  GeoMipTerrain::init_type();
125  NodeVertexTransform::init_type();
126  RigidBodyCombiner::init_type();
127  PipeOcclusionCullTraverser::init_type();
128  SceneGraphAnalyzerMeter::init_type();
129 
130 #ifdef HAVE_AUDIO
131  MovieTexture::init_type();
132  MovieTexture::register_with_read_factory();
133 
135  ts->register_texture_type(MovieTexture::make_texture, "avi m2v mov mpg mpeg mp4 wmv asf flv nut ogm mkv ogv");
136 #endif
137 }
This is a convenience class to specialize ConfigVariable as a boolean type.
This is a convenience class to specialize ConfigVariable as a floating-point type.
void register_texture_type(MakeTextureFunc *func, const string &extensions)
Records a factory function that makes a Texture object of the appropriate type for one or more partic...
Definition: texturePool.cxx:55
This is a convenience class to specialize ConfigVariable as a string type.
static TexturePool * get_global_ptr()
Initializes and/or returns the global pointer to the one TexturePool object in the system...
This is a convenience class to specialize ConfigVariable as an integer type.
This is the preferred interface for loading textures from image files.
Definition: texturePool.h:40