00001 // Filename: config_distort.cxx 00002 // Created by: drose (11Dec01) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved 00008 // 00009 // All use of this software is subject to the terms of the Panda 3d 00010 // Software license. You should have received a copy of this license 00011 // along with this source code; you will also find a current copy of 00012 // the license at http://www.panda3d.org/license.txt . 00013 // 00014 // To contact the maintainers of this program write to 00015 // panda3d@yahoogroups.com . 00016 // 00017 //////////////////////////////////////////////////////////////////// 00018 00019 #include "config_distort.h" 00020 #include "cylindricalLens.h" 00021 #include "fisheyeLens.h" 00022 #include "pSphereLens.h" 00023 #include "projectionScreen.h" 00024 00025 #include "dconfig.h" 00026 00027 Configure(config_distort); 00028 NotifyCategoryDef(distort, ""); 00029 00030 ConfigureFn(config_distort) { 00031 init_libdistort(); 00032 } 00033 00034 // Set this true to compensate for a graphics driver bug in which the 00035 // driver inverts the image when it copies framebuffer-to-texture. 00036 // (This bug is arguably a problem with the OpenGL spec, which seems 00037 // to be unclear about the proper ordering of pixels in this 00038 // operation.) 00039 const bool project_invert_uvs = config_distort.GetBool("project-invert-uvs", false); 00040 00041 //////////////////////////////////////////////////////////////////// 00042 // Function: init_libdistort 00043 // Description: Initializes the library. This must be called at 00044 // least once before any of the functions or classes in 00045 // this library can be used. Normally it will be 00046 // called by the static initializers and need not be 00047 // called explicitly, but special cases exist. 00048 //////////////////////////////////////////////////////////////////// 00049 void 00050 init_libdistort() { 00051 static bool initialized = false; 00052 if (initialized) { 00053 return; 00054 } 00055 initialized = true; 00056 00057 CylindricalLens::init_type(); 00058 FisheyeLens::init_type(); 00059 PSphereLens::init_type(); 00060 ProjectionScreen::init_type(); 00061 }