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-2006 Torus Knot Software Ltd 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 You may alternatively use this source under the terms of a specific version of 00025 the OGRE Unrestricted License provided you have obtained such a license from 00026 Torus Knot Software Ltd. 00027 ----------------------------------------------------------------------------- 00028 */ 00029 #ifndef __RenderSystemCapabilities__ 00030 #define __RenderSystemCapabilities__ 1 00031 00032 // Precompiler options 00033 #include "OgrePrerequisites.h" 00034 #include "OgreString.h" 00035 00036 namespace Ogre { 00037 00039 enum Capabilities 00040 { 00041 //RSC_MULTITEXTURE = 0x00000001, 00043 RSC_AUTOMIPMAP = 0x00000002, 00044 RSC_BLENDING = 0x00000004, 00046 RSC_ANISOTROPY = 0x00000008, 00048 RSC_DOT3 = 0x00000010, 00050 RSC_CUBEMAPPING = 0x00000020, 00052 RSC_HWSTENCIL = 0x00000040, 00054 RSC_VBO = 0x00000080, 00056 RSC_VERTEX_PROGRAM = 0x00000200, 00058 RSC_FRAGMENT_PROGRAM = 0x00000400, 00060 RSC_TEXTURE_COMPRESSION = 0x00000800, 00062 RSC_TEXTURE_COMPRESSION_DXT = 0x00001000, 00064 RSC_TEXTURE_COMPRESSION_VTC = 0x00002000, 00066 RSC_SCISSOR_TEST = 0x00004000, 00068 RSC_TWO_SIDED_STENCIL = 0x00008000, 00070 RSC_STENCIL_WRAP = 0x00010000, 00072 RSC_HWOCCLUSION = 0x00020000, 00074 RSC_USER_CLIP_PLANES = 0x00040000, 00076 RSC_VERTEX_FORMAT_UBYTE4 = 0x00080000, 00078 RSC_INFINITE_FAR_PLANE = 0x00100000, 00080 RSC_HWRENDER_TO_TEXTURE = 0x00200000, 00082 RSC_TEXTURE_FLOAT = 0x00400000, 00084 RSC_NON_POWER_OF_2_TEXTURES = 0x00800000, 00086 RSC_TEXTURE_3D = 0x01000000, 00088 RSC_POINT_SPRITES = 0x02000000, 00090 RSC_POINT_EXTENDED_PARAMETERS = 0x04000000, 00092 RSC_VERTEX_TEXTURE_FETCH = 0x08000000, 00094 RSC_MIPMAP_LOD_BIAS = 0x10000000 00095 00096 }; 00097 00103 class _OgreExport RenderSystemCapabilities 00104 { 00105 private: 00107 ushort mNumWorldMatrices; 00109 ushort mNumTextureUnits; 00111 ushort mStencilBufferBitDepth; 00113 ushort mNumVertexBlendMatrices; 00115 int mCapabilities; 00117 String mMaxVertexProgramVersion; 00119 String mMaxFragmentProgramVersion; 00121 ushort mVertexProgramConstantFloatCount; 00123 ushort mVertexProgramConstantIntCount; 00125 ushort mVertexProgramConstantBoolCount; 00127 ushort mFragmentProgramConstantFloatCount; 00129 ushort mFragmentProgramConstantIntCount; 00131 ushort mFragmentProgramConstantBoolCount; 00133 ushort mNumMultiRenderTargets; 00135 Real mMaxPointSize; 00137 bool mNonPOW2TexturesLimited; 00139 ushort mNumVertexTextureUnits; 00141 bool mVertexTextureUnitsShared; 00142 00143 public: 00144 RenderSystemCapabilities (); 00145 ~RenderSystemCapabilities (); 00146 00147 void setNumWorldMatricies(ushort num) 00148 { 00149 mNumWorldMatrices = num; 00150 } 00151 00152 void setNumTextureUnits(ushort num) 00153 { 00154 mNumTextureUnits = num; 00155 } 00156 00157 void setStencilBufferBitDepth(ushort num) 00158 { 00159 mStencilBufferBitDepth = num; 00160 } 00161 00162 void setNumVertexBlendMatrices(ushort num) 00163 { 00164 mNumVertexBlendMatrices = num; 00165 } 00166 00168 void setNumMultiRenderTargets(ushort num) 00169 { 00170 mNumMultiRenderTargets = num; 00171 } 00172 00173 ushort getNumWorldMatricies(void) const 00174 { 00175 return mNumWorldMatrices; 00176 } 00177 00188 ushort getNumTextureUnits(void) const 00189 { 00190 return mNumTextureUnits; 00191 } 00192 00199 ushort getStencilBufferBitDepth(void) const 00200 { 00201 return mStencilBufferBitDepth; 00202 } 00203 00206 ushort numVertexBlendMatrices(void) const 00207 { 00208 return mNumVertexBlendMatrices; 00209 } 00210 00212 ushort numMultiRenderTargets(void) const 00213 { 00214 return mNumMultiRenderTargets; 00215 } 00216 00219 void setCapability(const Capabilities c) 00220 { 00221 mCapabilities |= c; 00222 } 00223 00226 bool hasCapability(const Capabilities c) const 00227 { 00228 if(mCapabilities & c) 00229 { 00230 return true; 00231 } 00232 else 00233 { 00234 return false; 00235 } 00236 } 00238 const String& getMaxVertexProgramVersion(void) const 00239 { 00240 return mMaxVertexProgramVersion; 00241 } 00243 const String& getMaxFragmentProgramVersion(void) const 00244 { 00245 return mMaxFragmentProgramVersion; 00246 } 00248 ushort getVertexProgramConstantFloatCount(void) const 00249 { 00250 return mVertexProgramConstantFloatCount; 00251 } 00253 ushort getVertexProgramConstantIntCount(void) const 00254 { 00255 return mVertexProgramConstantIntCount; 00256 } 00258 ushort getVertexProgramConstantBoolCount(void) const 00259 { 00260 return mVertexProgramConstantBoolCount; 00261 } 00263 ushort getFragmentProgramConstantFloatCount(void) const 00264 { 00265 return mFragmentProgramConstantFloatCount; 00266 } 00268 ushort getFragmentProgramConstantIntCount(void) const 00269 { 00270 return mFragmentProgramConstantIntCount; 00271 } 00273 ushort getFragmentProgramConstantBoolCount(void) const 00274 { 00275 return mFragmentProgramConstantBoolCount; 00276 } 00277 00278 00279 00281 void setMaxVertexProgramVersion(const String& ver) 00282 { 00283 mMaxVertexProgramVersion = ver; 00284 } 00286 void setMaxFragmentProgramVersion(const String& ver) 00287 { 00288 mMaxFragmentProgramVersion = ver; 00289 } 00291 void setVertexProgramConstantFloatCount(ushort c) 00292 { 00293 mVertexProgramConstantFloatCount = c; 00294 } 00296 void setVertexProgramConstantIntCount(ushort c) 00297 { 00298 mVertexProgramConstantIntCount = c; 00299 } 00301 void setVertexProgramConstantBoolCount(ushort c) 00302 { 00303 mVertexProgramConstantBoolCount = c; 00304 } 00306 void setFragmentProgramConstantFloatCount(ushort c) 00307 { 00308 mFragmentProgramConstantFloatCount = c; 00309 } 00311 void setFragmentProgramConstantIntCount(ushort c) 00312 { 00313 mFragmentProgramConstantIntCount = c; 00314 } 00316 void setFragmentProgramConstantBoolCount(ushort c) 00317 { 00318 mFragmentProgramConstantBoolCount = c; 00319 } 00321 void setMaxPointSize(Real s) 00322 { 00323 mMaxPointSize = s; 00324 } 00326 Real getMaxPointSize(void) const 00327 { 00328 return mMaxPointSize; 00329 } 00331 void setNonPOW2TexturesLimited(bool l) 00332 { 00333 mNonPOW2TexturesLimited = l; 00334 } 00343 bool getNonPOW2TexturesLimited(void) const 00344 { 00345 return mNonPOW2TexturesLimited; 00346 } 00347 00349 void setNumVertexTextureUnits(ushort n) 00350 { 00351 mNumVertexTextureUnits = n; 00352 } 00354 ushort getNumVertexTextureUnits(void) const 00355 { 00356 return mNumVertexTextureUnits; 00357 } 00359 void setVertexTextureUnitsShared(bool shared) 00360 { 00361 mVertexTextureUnitsShared = shared; 00362 } 00364 bool getVertexTextureUnitsShared(void) const 00365 { 00366 return mVertexTextureUnitsShared; 00367 } 00368 00369 00371 void log(Log* pLog); 00372 00373 00374 00375 00376 }; 00377 } 00378 00379 #endif // __RenderSystemCapabilities__ 00380
Copyright © 2000-2005 by The OGRE Team
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Last modified Sun May 6 10:54:23 2007