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