Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class 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 (c) 2000-2005 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_VERTEX_PROGRAM          = 0x00000200,
00054         RSC_FRAGMENT_PROGRAM        = 0x00000400,
00056         RSC_TEXTURE_COMPRESSION     = 0x00000800,
00058         RSC_TEXTURE_COMPRESSION_DXT = 0x00001000,
00060         RSC_TEXTURE_COMPRESSION_VTC = 0x00002000,
00062         RSC_SCISSOR_TEST            = 0x00004000,
00064         RSC_TWO_SIDED_STENCIL       = 0x00008000,
00066         RSC_STENCIL_WRAP            = 0x00010000,
00068         RSC_HWOCCLUSION             = 0x00020000,
00070         RSC_USER_CLIP_PLANES        = 0x00040000,
00072         RSC_VERTEX_FORMAT_UBYTE4    = 0x00080000,
00074         RSC_INFINITE_FAR_PLANE      = 0x00100000,
00076         RSC_HWRENDER_TO_TEXTURE     = 0x00200000,
00078         RSC_TEXTURE_FLOAT           = 0x00400000,
00080         RSC_NON_POWER_OF_2_TEXTURES = 0x00800000,
00082         RSC_TEXTURE_3D              = 0x01000000,
00084         RSC_POINT_SPRITES           = 0x02000000,
00086         RSC_POINT_EXTENDED_PARAMETERS = 0x04000000
00087     };
00088 
00094     class _OgreExport RenderSystemCapabilities 
00095     {
00096         private:
00098             ushort mNumWorldMatrices;
00100             ushort mNumTextureUnits;
00102             ushort mStencilBufferBitDepth;
00104             ushort mNumVertexBlendMatrices;
00106             int mCapabilities;
00108             String mMaxVertexProgramVersion;
00110             String mMaxFragmentProgramVersion;
00112             ushort mVertexProgramConstantFloatCount;           
00114             ushort mVertexProgramConstantIntCount;           
00116             ushort mVertexProgramConstantBoolCount;           
00118             ushort mFragmentProgramConstantFloatCount;           
00120             ushort mFragmentProgramConstantIntCount;           
00122             ushort mFragmentProgramConstantBoolCount;
00124             ushort mNumMultiRenderTargets;
00126             Real mMaxPointSize;
00127 
00128         public: 
00129             RenderSystemCapabilities ();
00130             ~RenderSystemCapabilities ();
00131 
00132             void setNumWorldMatricies(ushort num)
00133             {
00134                 mNumWorldMatrices = num;
00135             }
00136 
00137             void setNumTextureUnits(ushort num)
00138             {
00139                 mNumTextureUnits = num;
00140             }
00141 
00142             void setStencilBufferBitDepth(ushort num)
00143             {
00144                 mStencilBufferBitDepth = num;
00145             }
00146 
00147             void setNumVertexBlendMatrices(ushort num)
00148             {
00149                 mNumVertexBlendMatrices = num;
00150             }
00151 
00153             void setNumMultiRenderTargets(ushort num)
00154             {
00155                 mNumMultiRenderTargets = num;
00156             }
00157 
00158             ushort getNumWorldMatricies(void) const
00159             { 
00160                 return mNumWorldMatrices;
00161             }
00162 
00173             ushort getNumTextureUnits(void) const
00174             {
00175                 return mNumTextureUnits;
00176             }
00177 
00184             ushort getStencilBufferBitDepth(void) const
00185             {
00186                 return mStencilBufferBitDepth;
00187             }
00188 
00191             ushort numVertexBlendMatrices(void) const
00192             {
00193                 return mNumVertexBlendMatrices;
00194             }
00195 
00197             ushort numMultiRenderTargets(void) const
00198             {
00199                 return mNumMultiRenderTargets;
00200             }
00201 
00204             void setCapability(const Capabilities c) 
00205             { 
00206                 mCapabilities |= c;
00207             }
00208 
00211             bool hasCapability(const Capabilities c) const
00212             {
00213                 if(mCapabilities & c)
00214                 {
00215                     return true;
00216                 }
00217                 else
00218                 {
00219                     return false;
00220                 }
00221             }
00223             const String& getMaxVertexProgramVersion(void) const
00224             {
00225                 return mMaxVertexProgramVersion;
00226             }
00228             const String& getMaxFragmentProgramVersion(void) const
00229             {
00230                 return mMaxFragmentProgramVersion;
00231             }
00233             ushort getVertexProgramConstantFloatCount(void) const
00234             {
00235                 return mVertexProgramConstantFloatCount;           
00236             }
00238             ushort getVertexProgramConstantIntCount(void) const
00239             {
00240                 return mVertexProgramConstantIntCount;           
00241             }
00243             ushort getVertexProgramConstantBoolCount(void) const
00244             {
00245                 return mVertexProgramConstantBoolCount;           
00246             }
00248             ushort getFragmentProgramConstantFloatCount(void) const
00249             {
00250                 return mFragmentProgramConstantFloatCount;           
00251             }
00253             ushort getFragmentProgramConstantIntCount(void) const
00254             {
00255                 return mFragmentProgramConstantIntCount;           
00256             }
00258             ushort getFragmentProgramConstantBoolCount(void) const
00259             {
00260                 return mFragmentProgramConstantBoolCount;           
00261             }
00262 
00263 
00264 
00266             void setMaxVertexProgramVersion(const String& ver)
00267             {
00268                 mMaxVertexProgramVersion = ver;
00269             }
00271             void setMaxFragmentProgramVersion(const String& ver)
00272             {
00273                 mMaxFragmentProgramVersion = ver;
00274             }
00276             void setVertexProgramConstantFloatCount(ushort c)
00277             {
00278                 mVertexProgramConstantFloatCount = c;           
00279             }
00281             void setVertexProgramConstantIntCount(ushort c)
00282             {
00283                 mVertexProgramConstantIntCount = c;           
00284             }
00286             void setVertexProgramConstantBoolCount(ushort c)
00287             {
00288                 mVertexProgramConstantBoolCount = c;           
00289             }
00291             void setFragmentProgramConstantFloatCount(ushort c)
00292             {
00293                 mFragmentProgramConstantFloatCount = c;           
00294             }
00296             void setFragmentProgramConstantIntCount(ushort c)
00297             {
00298                 mFragmentProgramConstantIntCount = c;           
00299             }
00301             void setFragmentProgramConstantBoolCount(ushort c)
00302             {
00303                 mFragmentProgramConstantBoolCount = c;           
00304             }
00306             void setMaxPointSize(Real s)
00307             {
00308                 mMaxPointSize = s;
00309             }
00311             Real getMaxPointSize(void) const
00312             {
00313                 return mMaxPointSize;
00314             }
00315 
00316 
00318             void log(Log* pLog);
00319 
00320 
00321 
00322 
00323     };
00324 }
00325 
00326 #endif // __RenderSystemCapabilities__
00327 

Copyright © 2000-2005 by The OGRE Team
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Last modified Sun Jul 23 10:05:40 2006