Panda3D
|
00001 // Filename: config_distort.cxx 00002 // Created by: drose (11Dec01) 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_distort.h" 00016 #include "cylindricalLens.h" 00017 #include "fisheyeLens.h" 00018 #include "pSphereLens.h" 00019 #include "projectionScreen.h" 00020 00021 #include "dconfig.h" 00022 00023 Configure(config_distort); 00024 NotifyCategoryDef(distort, ""); 00025 00026 ConfigureFn(config_distort) { 00027 init_libdistort(); 00028 } 00029 00030 ConfigVariableBool project_invert_uvs 00031 ("project-invert-uvs", false, 00032 PRC_DESC("If this is true, the UV's generated by all ProjectionScreens are " 00033 "inverted top-to-bottom. This used to be required to compensate " 00034 "for buggy graphics drivers that rendered to a texture upside-down " 00035 "in this manner, but nowadays Panda should be able to autodetect " 00036 "these graphics drivers. If it fails to do this, you should " 00037 "probably set copy-texture-inverted instead, which is more general.")); 00038 00039 //////////////////////////////////////////////////////////////////// 00040 // Function: init_libdistort 00041 // Description: Initializes the library. This must be called at 00042 // least once before any of the functions or classes in 00043 // this library can be used. Normally it will be 00044 // called by the static initializers and need not be 00045 // called explicitly, but special cases exist. 00046 //////////////////////////////////////////////////////////////////// 00047 void 00048 init_libdistort() { 00049 static bool initialized = false; 00050 if (initialized) { 00051 return; 00052 } 00053 initialized = true; 00054 00055 CylindricalLens::init_type(); 00056 FisheyeLens::init_type(); 00057 PSphereLens::init_type(); 00058 ProjectionScreen::init_type(); 00059 }