KeosRenderSystemCapabilities.h

Go to the documentation of this file.
00001 /*
00002  * This source file is part of KEOS (Free 3D Engine)
00003  * For the latest info, see http://www.keosengine.org/
00004  * E-mails : thierry.vouriot@keosengine.org, yeri@keosengine.org
00005  *
00006  * This program is free software; you can redistribute it and/or modify it under
00007  * the terms of the GNU Lesser General Public License as published by the Free Software
00008  * Foundation; either version 2 of the License, or (at your option) any later
00009  * version.
00010  *
00011  * This program is distributed in the hope that it will be useful, but WITHOUT
00012  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00013  * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU Lesser General Public License along with
00016  * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
00017  * Place - Suite 330, Boston, MA 02111-1307, USA, or go to
00018  * http://www.gnu.org/copyleft/lesser.txt.
00019  *
00020  */
00021 
00022 #ifndef KEOS_RENDERSYSTEMCAPABILITIES_H
00023 #define KEOS_RENDERSYSTEMCAPABILITIES_H
00024 
00025 #include "KeosPrerequisites.h"
00026 
00027 namespace Keos
00028 {
00030   enum TCapability
00031   {
00033     CAP_HW_MIPMAPPING           = 0x00000001,
00035     CAP_TEXTURE_COMPRESSION_DXT = 0x00000002,
00037     CAP_NON_POWER_OF_2_TEXTURES = 0x00000004,
00039     CAP_VERTEX_PROGRAM          = 0x00000008,
00041     CAP_FRAGMENT_PROGRAM        = 0x00000010,
00042 
00043 
00044     // not yet support
00045     /*        //RSC_MULTITEXTURE          = 0x00000001,
00046             RSC_BLENDING                = 0x00000004,
00048             RSC_ANISOTROPY              = 0x00000008,
00050             RSC_DOT3                    = 0x00000010,
00052             RSC_CUBEMAPPING             = 0x00000020,
00054             RSC_HWSTENCIL               = 0x00000040,
00056             RSC_VBO                     = 0x00000080,
00058       RSC_TEXTURE_COMPRESSION     = 0x00000800,
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_TEXTURE_3D    = 0x01000000
00081     */
00082   };
00083 
00084   //-----------------------------------------------------------------------
00088   class KEOS_EXPORT CRenderSystemCapabilities
00089   {
00090   private:
00091 
00093     ushort m_nNumTextureUnits;
00095     String m_strMaxVertexProgramVersion;
00097     String m_strMaxFragmentProgramVersion;
00098 
00100     int m_nCapabilities;
00101 
00102   public:
00103 
00106     CRenderSystemCapabilities ();
00107 
00110     ~CRenderSystemCapabilities ();
00111 
00115     void SetNumTextureUnits(ushort nNum)
00116     {
00117       m_nNumTextureUnits = nNum;
00118     }
00119 
00123     ushort GetNumTextureUnits(void) const
00124     {
00125       return m_nNumTextureUnits;
00126     }
00127 
00130     void SetCapability(const TCapability c)
00131     {
00132       m_nCapabilities |= c;
00133     }
00134 
00137     bool HasCapability(const TCapability c) const
00138     {
00139       if (m_nCapabilities & c)
00140       {
00141         return true;
00142       }
00143       else
00144       {
00145         return false;
00146       }
00147     }
00148 
00151     const String& GetMaxVertexProgramVersion(void) const
00152     {
00153       return m_strMaxVertexProgramVersion;
00154     }
00155 
00158     const String& GetMaxFragmentProgramVersion(void) const
00159     {
00160       return m_strMaxFragmentProgramVersion;
00161     }
00162 
00165     void SetMaxVertexProgramVersion(const String& strVer)
00166     {
00167       m_strMaxVertexProgramVersion = strVer;
00168     }
00169 
00172     void SetMaxFragmentProgramVersion(const String& strVer)
00173     {
00174       m_strMaxFragmentProgramVersion = strVer;
00175     }
00176 
00179     void Log();
00180 
00181   };
00182 
00183 } // namespave Keos
00184 
00185 #endif // KEOS_RENDERSYSTEMCAPABILITIES_H
00186 

Generated on Fri Mar 9 14:29:03 2007 for Keos by  doxygen 1.5.1-p1