Panda3D
config_distort.cxx
1 // Filename: config_distort.cxx
2 // Created by: drose (11Dec01)
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_distort.h"
16 #include "cylindricalLens.h"
17 #include "fisheyeLens.h"
18 #include "pSphereLens.h"
19 #include "oSphereLens.h"
20 #include "projectionScreen.h"
21 
22 #include "dconfig.h"
23 
24 Configure(config_distort);
25 NotifyCategoryDef(distort, "");
26 
27 ConfigureFn(config_distort) {
28  init_libdistort();
29 }
30 
31 ConfigVariableBool project_invert_uvs
32 ("project-invert-uvs", false,
33  PRC_DESC("If this is true, the UV's generated by all ProjectionScreens are "
34  "inverted top-to-bottom. This used to be required to compensate "
35  "for buggy graphics drivers that rendered to a texture upside-down "
36  "in this manner, but nowadays Panda should be able to autodetect "
37  "these graphics drivers. If it fails to do this, you should "
38  "probably set copy-texture-inverted instead, which is more general."));
39 
40 ////////////////////////////////////////////////////////////////////
41 // Function: init_libdistort
42 // Description: Initializes the library. This must be called at
43 // least once before any of the functions or classes in
44 // this library can be used. Normally it will be
45 // called by the static initializers and need not be
46 // called explicitly, but special cases exist.
47 ////////////////////////////////////////////////////////////////////
48 void
49 init_libdistort() {
50  static bool initialized = false;
51  if (initialized) {
52  return;
53  }
54  initialized = true;
55 
56  CylindricalLens::init_type();
57  FisheyeLens::init_type();
58  PSphereLens::init_type();
59  OSphereLens::init_type();
60  ProjectionScreen::init_type();
61 }
This is a convenience class to specialize ConfigVariable as a boolean type.