Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

OgreRenderSystemCapabilities.h

Go to the documentation of this file.
00001 /*
00002 -----------------------------------------------------------------------------
00003 This source file is part of OGRE
00004     (Object-oriented Graphics Rendering Engine)
00005 For the latest info, see http://www.ogre3d.org/
00006 
00007 Copyright © 2000-2003 The OGRE Team
00008 Also see acknowledgements in Readme.html
00009 
00010 This program is free software; you can redistribute it and/or modify it under
00011 the terms of the GNU Lesser General Public License as published by the Free Software
00012 Foundation; either version 2 of the License, or (at your option) any later
00013 version.
00014 
00015 This program is distributed in the hope that it will be useful, but WITHOUT
00016 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00017 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
00018 
00019 You should have received a copy of the GNU Lesser General Public License along with
00020 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
00021 Place - Suite 330, Boston, MA 02111-1307, USA, or go to
00022 http://www.gnu.org/copyleft/lesser.txt.
00023 -----------------------------------------------------------------------------
00024 */
00025 #ifndef __RenderSystemCapabilities__
00026 #define __RenderSystemCapabilities__ 1
00027 
00028 // Precompiler options
00029 #include "OgrePrerequisites.h"
00030 #include "OgreString.h"
00031 
00032 namespace Ogre {
00033 
00035     enum Capabilities
00036     {
00037         //RSC_MULTITEXTURE          = 0x00000001,
00039         RSC_AUTOMIPMAP              = 0x00000002,
00040         RSC_BLENDING                = 0x00000004,
00042         RSC_ANISOTROPY              = 0x00000008,
00044         RSC_DOT3                    = 0x00000010,
00046         RSC_CUBEMAPPING             = 0x00000020,
00048         RSC_HWSTENCIL               = 0x00000040,
00050         RSC_VBO                     = 0x00000080,
00052         RSC_VERTEXBLENDING          = 0x00000100,
00054         RSC_VERTEX_PROGRAM          = 0x00000200,
00056         RSC_FRAGMENT_PROGRAM        = 0x00000400,
00058         RSC_TEXTURE_COMPRESSION     = 0x00000800,
00060         RSC_TEXTURE_COMPRESSION_DXT = 0x00001000,
00062         RSC_TEXTURE_COMPRESSION_VTC = 0x00002000,
00064         RSC_SCISSOR_TEST            = 0x00004000,
00066         RSC_TWO_SIDED_STENCIL       = 0x00008000,
00068         RSC_STENCIL_WRAP            = 0x00010000,
00070         RSC_HWOCCLUSION             = 0x00020000,
00072         RSC_USER_CLIP_PLANES        = 0x00040000,
00074         RSC_VERTEX_FORMAT_UBYTE4    = 0x00080000,
00076         RSC_INFINITE_FAR_PLANE      = 0x00100000
00077 
00078     };
00079 
00085     class _OgreExport RenderSystemCapabilities 
00086     {
00087         private:
00089             ushort mNumWorldMatrices;
00091             ushort mNumTextureUnits;
00093             ushort mStencilBufferBitDepth;
00095             ushort mNumVertexBlendMatrices;
00097             int mCapabilities;
00099             String mMaxVertexProgramVersion;
00101             String mMaxFragmentProgramVersion;
00103             ushort mVertexProgramConstantFloatCount;           
00105             ushort mVertexProgramConstantIntCount;           
00107             ushort mVertexProgramConstantBoolCount;           
00109             ushort mFragmentProgramConstantFloatCount;           
00111             ushort mFragmentProgramConstantIntCount;           
00113             ushort mFragmentProgramConstantBoolCount;
00114 
00115         public: 
00116             RenderSystemCapabilities ();
00117             ~RenderSystemCapabilities ();
00118 
00119             void setNumWorldMatricies(ushort num)
00120             {
00121                 mNumWorldMatrices = num;
00122             }
00123 
00124             void setNumTextureUnits(ushort num)
00125             {
00126                 mNumTextureUnits = num;
00127             }
00128 
00129             void setStencilBufferBitDepth(ushort num)
00130             {
00131                 mStencilBufferBitDepth = num;
00132             }
00133 
00134             void setNumVertexBlendMatrices(ushort num)
00135             {
00136                 mNumVertexBlendMatrices = num;
00137             }
00138 
00139             ushort getNumWorldMatricies(void) const
00140             { 
00141                 return mNumWorldMatrices;
00142             }
00143 
00154             ushort getNumTextureUnits(void) const
00155             {
00156                 return mNumTextureUnits;
00157             }
00158 
00165             ushort getStencilBufferBitDepth(void) const
00166             {
00167                 return mStencilBufferBitDepth;
00168             }
00169 
00172             ushort numVertexBlendMatrices(void) const
00173             {
00174                 return mNumVertexBlendMatrices;
00175             }
00176 
00179             void setCapability(const Capabilities c) 
00180             { 
00181                 mCapabilities |= c;
00182             }
00183 
00186             bool hasCapability(const Capabilities c) const
00187             {
00188                 if(mCapabilities & c)
00189                 {
00190                     return true;
00191                 }
00192                 else
00193                 {
00194                     return false;
00195                 }
00196             }
00198             const String& getMaxVertexProgramVersion(void) const
00199             {
00200                 return mMaxVertexProgramVersion;
00201             }
00203             const String& getMaxFragmentProgramVersion(void) const
00204             {
00205                 return mMaxFragmentProgramVersion;
00206             }
00208             ushort getVertexProgramConstantFloatCount(void) const
00209             {
00210                 return mVertexProgramConstantFloatCount;           
00211             }
00213             ushort getVertexProgramConstantIntCount(void) const
00214             {
00215                 return mVertexProgramConstantIntCount;           
00216             }
00218             ushort getVertexProgramConstantBoolCount(void) const
00219             {
00220                 return mVertexProgramConstantBoolCount;           
00221             }
00223             ushort getFragmentProgramConstantFloatCount(void) const
00224             {
00225                 return mFragmentProgramConstantFloatCount;           
00226             }
00228             ushort getFragmentProgramConstantIntCount(void) const
00229             {
00230                 return mFragmentProgramConstantIntCount;           
00231             }
00233             ushort getFragmentProgramConstantBoolCount(void) const
00234             {
00235                 return mFragmentProgramConstantBoolCount;           
00236             }
00237 
00238 
00239 
00241             void setMaxVertexProgramVersion(const String& ver)
00242             {
00243                 mMaxVertexProgramVersion = ver;
00244             }
00246             void setMaxFragmentProgramVersion(const String& ver)
00247             {
00248                 mMaxFragmentProgramVersion = ver;
00249             }
00251             void setVertexProgramConstantFloatCount(ushort c)
00252             {
00253                 mVertexProgramConstantFloatCount = c;           
00254             }
00256             void setVertexProgramConstantIntCount(ushort c)
00257             {
00258                 mVertexProgramConstantIntCount = c;           
00259             }
00261             void setVertexProgramConstantBoolCount(ushort c)
00262             {
00263                 mVertexProgramConstantBoolCount = c;           
00264             }
00266             void setFragmentProgramConstantFloatCount(ushort c)
00267             {
00268                 mFragmentProgramConstantFloatCount = c;           
00269             }
00271             void setFragmentProgramConstantIntCount(ushort c)
00272             {
00273                 mFragmentProgramConstantIntCount = c;           
00274             }
00276             void setFragmentProgramConstantBoolCount(ushort c)
00277             {
00278                 mFragmentProgramConstantBoolCount = c;           
00279             }
00280 
00282             void log(Log* pLog);
00283 
00284 
00285 
00286 
00287     };
00288 };
00289 
00290 #endif // __RenderSystemCapabilities__
00291 

Copyright © 2002-2003 by The OGRE Team
Last modified Fri May 14 23:22:40 2004