diff --git a/panda/src/glstuff/Sources.pp b/panda/src/glstuff/Sources.pp index e2c5adde7e..d8809a3b3c 100644 --- a/panda/src/glstuff/Sources.pp +++ b/panda/src/glstuff/Sources.pp @@ -13,6 +13,8 @@ #define INSTALL_HEADERS \ glext.h \ + glmisc_src.cxx \ + glmisc_src.h \ glstuff_src.cxx \ glstuff_src.h \ glstuff_undef_src.h \ diff --git a/panda/src/glstuff/glmisc_src.cxx b/panda/src/glstuff/glmisc_src.cxx index 340df594bd..bf6c68b06c 100644 --- a/panda/src/glstuff/glmisc_src.cxx +++ b/panda/src/glstuff/glmisc_src.cxx @@ -17,45 +17,55 @@ //////////////////////////////////////////////////////////////////// -// Configure this true to GLP(Hint) the textures into the cheapest -// possible mode. -bool CLP(cheap_textures) = CONFIGOBJ.GetBool("gl-cheap-textures", false); +ConfigVariableBool CLP(cheap_textures) + ("gl-cheap-textures", false, + PRC_DESC("Configure this true to GLP(Hint) the textures into the cheapest " + "possible mode.")); -// Configure this true to disable texture clamp mode (all textures -// repeat, a little cheaper for software renderers). -bool CLP(ignore_clamp) = CONFIGOBJ.GetBool("gl-ignore-clamp", false); +ConfigVariableBool CLP(ignore_clamp) + ("gl-ignore-clamp", false, + PRC_DESC("Configure this true to disable texture clamp mode (all textures " + "repeat, a little cheaper for software renderers).")); -// Configure this true to disable any texture filters at all (forcing -// point sampling). -bool CLP(ignore_filters) = CONFIGOBJ.GetBool("gl-ignore-filters", false); +ConfigVariableBool CLP(ignore_filters) + ("gl-ignore-filters", false, + PRC_DESC("Configure this true to disable any texture filters at all (forcing " + "point sampling).")); -// Configure this true to disable mipmapping only. -bool CLP(ignore_mipmaps) = CONFIGOBJ.GetBool("gl-ignore-mipmaps", false) || CLP(ignore_filters); +ConfigVariableBool CLP(ignore_mipmaps) + ("gl-ignore-mipmaps", false, + PRC_DESC("Configure this true to disable mipmapping only.")); -// Configure this true to enable full trilinear mipmapping on every -// texture, whether it asks for it or not. -bool CLP(force_mipmaps) = CONFIGOBJ.GetBool("gl-force-mipmaps", false); +ConfigVariableBool CLP(force_mipmaps) + ("gl-force-mipmaps", false, + PRC_DESC("Configure this true to enable full trilinear mipmapping on every " + "texture, whether it asks for it or not.")); -// Configure this true to cause mipmaps to be rendered with phony -// colors, using mipmap_level_*.rgb if they are available. -bool CLP(show_mipmaps) = CONFIGOBJ.GetBool("gl-show-mipmaps", false); +ConfigVariableBool CLP(show_mipmaps) + ("gl-show-mipmaps", false, + PRC_DESC("Configure this true to cause mipmaps to be rendered with phony " + "colors, using mipmap_level_*.rgb if they are available.")); -// Configure this true to cause the generated mipmap images to be -// written out to image files on the disk as they are generated. -bool CLP(save_mipmaps) = CONFIGOBJ.GetBool("gl-save-mipmaps", false); +ConfigVariableBool CLP(save_mipmaps) + ("gl-save-mipmaps", false, + PRC_DESC("Configure this true to cause the generated mipmap images to be " + "written out to image files on the disk as they are generated.")); -// Configure this true to cause all lighting normals to automatically -// be normalized by the graphics hardware before rendering. This is -// necessary if you intend to render things under scale transforms and -// expect lighting to work correctly. Maybe one day there will be -// another way to set this at runtime, instead of only as a configure -// variable. -bool CLP(auto_normalize_lighting) = CONFIGOBJ.GetBool("auto-normalize-lighting", true); +ConfigVariableBool CLP(auto_normalize_lighting) + ("auto-normalize-lighting", true, + PRC_DESC("Configure this true to cause all lighting normals to automatically " + "be normalized by the graphics hardware before rendering. This is " + "necessary if you intend to render things under scale transforms and " + "expect lighting to work correctly. Maybe one day there will be " + "another way to set this at runtime, instead of only as a configure " + "variable.")); + +ConfigVariableBool CLP(color_mask) + ("gl-color-mask", true, + PRC_DESC("Configure this false if your GL's implementation of glColorMask() " + "is broken (some are). This will force the use of a (presumably) " + "more expensive blending operation instead.")); -// Configure this false if your GL's implementation of GLP(ColorMask)() -// is broken (some are). This will force the use of a (presumably) -// more expensive blending operation instead. -bool CLP(color_mask) = CONFIGOBJ.GetBool("gl-color-mask", true); void CLP(init_classes)() { CLP(GraphicsStateGuardian)::init_type(); diff --git a/panda/src/glstuff/glmisc_src.h b/panda/src/glstuff/glmisc_src.h index 545c415876..24d97a9efe 100644 --- a/panda/src/glstuff/glmisc_src.h +++ b/panda/src/glstuff/glmisc_src.h @@ -17,18 +17,19 @@ //////////////////////////////////////////////////////////////////// #include "pandabase.h" +#include "configVariableBool.h" //#define GSG_VERBOSE 1 -extern bool CLP(cheap_textures); -extern bool CLP(ignore_clamp); -extern bool CLP(ignore_filters); -extern bool CLP(ignore_mipmaps); -extern bool CLP(force_mipmaps); -extern bool CLP(show_mipmaps); -extern bool CLP(save_mipmaps); -extern bool CLP(auto_normalize_lighting); -extern bool CLP(color_mask); +extern ConfigVariableBool CLP(cheap_textures); +extern ConfigVariableBool CLP(ignore_clamp); +extern ConfigVariableBool CLP(ignore_filters); +extern ConfigVariableBool CLP(ignore_mipmaps); +extern ConfigVariableBool CLP(force_mipmaps); +extern ConfigVariableBool CLP(show_mipmaps); +extern ConfigVariableBool CLP(save_mipmaps); +extern ConfigVariableBool CLP(auto_normalize_lighting); +extern ConfigVariableBool CLP(color_mask); extern EXPCL_GL void CLP(init_classes)();