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;
00128             bool mNonPOW2TexturesLimited;
00129 
00130         public: 
00131             RenderSystemCapabilities ();
00132             ~RenderSystemCapabilities ();
00133 
00134             void setNumWorldMatricies(ushort num)
00135             {
00136                 mNumWorldMatrices = num;
00137             }
00138 
00139             void setNumTextureUnits(ushort num)
00140             {
00141                 mNumTextureUnits = num;
00142             }
00143 
00144             void setStencilBufferBitDepth(ushort num)
00145             {
00146                 mStencilBufferBitDepth = num;
00147             }
00148 
00149             void setNumVertexBlendMatrices(ushort num)
00150             {
00151                 mNumVertexBlendMatrices = num;
00152             }
00153 
00155             void setNumMultiRenderTargets(ushort num)
00156             {
00157                 mNumMultiRenderTargets = num;
00158             }
00159 
00160             ushort getNumWorldMatricies(void) const
00161             { 
00162                 return mNumWorldMatrices;
00163             }
00164 
00175             ushort getNumTextureUnits(void) const
00176             {
00177                 return mNumTextureUnits;
00178             }
00179 
00186             ushort getStencilBufferBitDepth(void) const
00187             {
00188                 return mStencilBufferBitDepth;
00189             }
00190 
00193             ushort numVertexBlendMatrices(void) const
00194             {
00195                 return mNumVertexBlendMatrices;
00196             }
00197 
00199             ushort numMultiRenderTargets(void) const
00200             {
00201                 return mNumMultiRenderTargets;
00202             }
00203 
00206             void setCapability(const Capabilities c) 
00207             { 
00208                 mCapabilities |= c;
00209             }
00210 
00213             bool hasCapability(const Capabilities c) const
00214             {
00215                 if(mCapabilities & c)
00216                 {
00217                     return true;
00218                 }
00219                 else
00220                 {
00221                     return false;
00222                 }
00223             }
00225             const String& getMaxVertexProgramVersion(void) const
00226             {
00227                 return mMaxVertexProgramVersion;
00228             }
00230             const String& getMaxFragmentProgramVersion(void) const
00231             {
00232                 return mMaxFragmentProgramVersion;
00233             }
00235             ushort getVertexProgramConstantFloatCount(void) const
00236             {
00237                 return mVertexProgramConstantFloatCount;           
00238             }
00240             ushort getVertexProgramConstantIntCount(void) const
00241             {
00242                 return mVertexProgramConstantIntCount;           
00243             }
00245             ushort getVertexProgramConstantBoolCount(void) const
00246             {
00247                 return mVertexProgramConstantBoolCount;           
00248             }
00250             ushort getFragmentProgramConstantFloatCount(void) const
00251             {
00252                 return mFragmentProgramConstantFloatCount;           
00253             }
00255             ushort getFragmentProgramConstantIntCount(void) const
00256             {
00257                 return mFragmentProgramConstantIntCount;           
00258             }
00260             ushort getFragmentProgramConstantBoolCount(void) const
00261             {
00262                 return mFragmentProgramConstantBoolCount;           
00263             }
00264 
00265 
00266 
00268             void setMaxVertexProgramVersion(const String& ver)
00269             {
00270                 mMaxVertexProgramVersion = ver;
00271             }
00273             void setMaxFragmentProgramVersion(const String& ver)
00274             {
00275                 mMaxFragmentProgramVersion = ver;
00276             }
00278             void setVertexProgramConstantFloatCount(ushort c)
00279             {
00280                 mVertexProgramConstantFloatCount = c;           
00281             }
00283             void setVertexProgramConstantIntCount(ushort c)
00284             {
00285                 mVertexProgramConstantIntCount = c;           
00286             }
00288             void setVertexProgramConstantBoolCount(ushort c)
00289             {
00290                 mVertexProgramConstantBoolCount = c;           
00291             }
00293             void setFragmentProgramConstantFloatCount(ushort c)
00294             {
00295                 mFragmentProgramConstantFloatCount = c;           
00296             }
00298             void setFragmentProgramConstantIntCount(ushort c)
00299             {
00300                 mFragmentProgramConstantIntCount = c;           
00301             }
00303             void setFragmentProgramConstantBoolCount(ushort c)
00304             {
00305                 mFragmentProgramConstantBoolCount = c;           
00306             }
00308             void setMaxPointSize(Real s)
00309             {
00310                 mMaxPointSize = s;
00311             }
00313             Real getMaxPointSize(void) const
00314             {
00315                 return mMaxPointSize;
00316             }
00318             void setNonPOW2TexturesLimited(bool l)
00319             {
00320                 mNonPOW2TexturesLimited = l;
00321             }
00330             bool getNonPOW2TexturesLimited(void) const
00331             {
00332                 return mNonPOW2TexturesLimited;
00333             }
00334 
00335 
00337             void log(Log* pLog);
00338 
00339 
00340 
00341 
00342     };
00343 }
00344 
00345 #endif // __RenderSystemCapabilities__
00346 

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 Nov 12 10:50:13 2006