Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/ogre/OgreMain/src/OgreRenderSystemCapabilities.cpp @ 48

Last change on this file since 48 was 5, checked in by anonymous, 17 years ago

=hoffentlich gehts jetzt

File size: 7.2 KB
Line 
1/*
2-----------------------------------------------------------------------------
3This source file is part of OGRE
4    (Object-oriented Graphics Rendering Engine)
5For the latest info, see http://www.ogre3d.org/
6
7Copyright (c) 2000-2006 Torus Knot Software Ltd
8Also see acknowledgements in Readme.html
9
10This program is free software; you can redistribute it and/or modify it under
11the terms of the GNU Lesser General Public License as published by the Free Software
12Foundation; either version 2 of the License, or (at your option) any later
13version.
14
15This program is distributed in the hope that it will be useful, but WITHOUT
16ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
18
19You should have received a copy of the GNU Lesser General Public License along with
20this program; if not, write to the Free Software Foundation, Inc., 59 Temple
21Place - Suite 330, Boston, MA 02111-1307, USA, or go to
22http://www.gnu.org/copyleft/lesser.txt.
23
24You may alternatively use this source under the terms of a specific version of
25the OGRE Unrestricted License provided you have obtained such a license from
26Torus Knot Software Ltd.
27-----------------------------------------------------------------------------
28*/
29#include "OgreStableHeaders.h"
30
31#include "OgreRenderSystemCapabilities.h"
32#include "OgreLogManager.h"
33#include "OgreStringConverter.h"
34#include "OgreException.h"
35
36namespace Ogre {
37
38    //-----------------------------------------------------------------------
39    RenderSystemCapabilities::RenderSystemCapabilities()
40      : mNumWorldMatrices(0), mNumTextureUnits(0), mStencilBufferBitDepth(0),
41        mNumVertexBlendMatrices(0), mCapabilities(0), mNumMultiRenderTargets(1), 
42                mNonPOW2TexturesLimited(false)
43    {
44    }
45    //-----------------------------------------------------------------------
46    RenderSystemCapabilities::~RenderSystemCapabilities()
47    {
48    }
49    //-----------------------------------------------------------------------
50    void RenderSystemCapabilities::log(Log* pLog)
51    {
52        pLog->logMessage("RenderSystem capabilities");
53        pLog->logMessage("-------------------------");
54        pLog->logMessage(
55            " * Hardware generation of mipmaps: "
56            + StringConverter::toString(hasCapability(RSC_AUTOMIPMAP), true));
57        pLog->logMessage(
58            " * Texture blending: "
59            + StringConverter::toString(hasCapability(RSC_BLENDING), true));
60        pLog->logMessage(
61            " * Anisotropic texture filtering: "
62            + StringConverter::toString(hasCapability(RSC_ANISOTROPY), true));
63        pLog->logMessage(
64            " * Dot product texture operation: "
65            + StringConverter::toString(hasCapability(RSC_DOT3), true));
66        pLog->logMessage(
67            " * Cube mapping: "
68            + StringConverter::toString(hasCapability(RSC_CUBEMAPPING), true));
69        pLog->logMessage(
70            " * Hardware stencil buffer: "
71            + StringConverter::toString(hasCapability(RSC_HWSTENCIL), true));
72        if (hasCapability(RSC_HWSTENCIL))
73        {
74            pLog->logMessage(
75                "   - Stencil depth: "
76                + StringConverter::toString(getStencilBufferBitDepth()));
77            pLog->logMessage(
78                "   - Two sided stencil support: "
79                + StringConverter::toString(hasCapability(RSC_TWO_SIDED_STENCIL), true));
80            pLog->logMessage(
81                "   - Wrap stencil values: "
82                + StringConverter::toString(hasCapability(RSC_STENCIL_WRAP), true));
83        }
84        pLog->logMessage(
85            " * Hardware vertex / index buffers: "
86            + StringConverter::toString(hasCapability(RSC_VBO), true));
87        pLog->logMessage(
88            " * Vertex programs: "
89            + StringConverter::toString(hasCapability(RSC_VERTEX_PROGRAM), true));
90        if (hasCapability(RSC_VERTEX_PROGRAM))
91        {
92            pLog->logMessage(
93                "   - Max vertex program version: "
94                + getMaxVertexProgramVersion());
95        }
96        pLog->logMessage(
97            " * Fragment programs: "
98            + StringConverter::toString(hasCapability(RSC_FRAGMENT_PROGRAM), true));
99        if (hasCapability(RSC_FRAGMENT_PROGRAM))
100        {
101            pLog->logMessage(
102                "   - Max fragment program version: "
103                + getMaxFragmentProgramVersion());
104        }
105
106        pLog->logMessage(
107            " * Texture Compression: "
108            + StringConverter::toString(hasCapability(RSC_TEXTURE_COMPRESSION), true));
109        if (hasCapability(RSC_TEXTURE_COMPRESSION))
110        {
111            pLog->logMessage(
112                "   - DXT: "
113                + StringConverter::toString(hasCapability(RSC_TEXTURE_COMPRESSION_DXT), true));
114            pLog->logMessage(
115                "   - VTC: "
116                + StringConverter::toString(hasCapability(RSC_TEXTURE_COMPRESSION_VTC), true));
117        }
118
119        pLog->logMessage(
120            " * Scissor Rectangle: "
121            + StringConverter::toString(hasCapability(RSC_SCISSOR_TEST), true));
122        pLog->logMessage(
123            " * Hardware Occlusion Query: "
124            + StringConverter::toString(hasCapability(RSC_HWOCCLUSION), true));
125        pLog->logMessage(
126            " * User clip planes: "
127            + StringConverter::toString(hasCapability(RSC_USER_CLIP_PLANES), true));
128        pLog->logMessage(
129            " * VET_UBYTE4 vertex element type: "
130            + StringConverter::toString(hasCapability(RSC_VERTEX_FORMAT_UBYTE4), true));
131        pLog->logMessage(
132            " * Infinite far plane projection: "
133            + StringConverter::toString(hasCapability(RSC_INFINITE_FAR_PLANE), true));
134                pLog->logMessage(
135            " * Hardware render-to-texture: "
136            + StringConverter::toString(hasCapability(RSC_HWRENDER_TO_TEXTURE), true));
137        pLog->logMessage(
138            " * Floating point textures: "
139            + StringConverter::toString(hasCapability(RSC_TEXTURE_FLOAT), true));
140        pLog->logMessage(
141            " * Non-power-of-two textures: "
142            + StringConverter::toString(hasCapability(RSC_NON_POWER_OF_2_TEXTURES), true)
143                        + (mNonPOW2TexturesLimited ? " (limited)" : ""));
144                pLog->logMessage(
145            " * Volume textures: "
146            + StringConverter::toString(hasCapability(RSC_TEXTURE_3D), true));
147                pLog->logMessage(
148            " * Multiple Render Targets: "
149            + StringConverter::toString(mNumMultiRenderTargets));
150                pLog->logMessage(
151                        " * Point Sprites: "
152                        + StringConverter::toString(hasCapability(RSC_POINT_SPRITES), true));
153                pLog->logMessage(
154                        " * Extended point parameters: "
155                        + StringConverter::toString(hasCapability(RSC_POINT_EXTENDED_PARAMETERS), true));
156                pLog->logMessage(
157                        " * Max Point Size: "
158                        + StringConverter::toString(mMaxPointSize));
159                pLog->logMessage(
160                        " * Vertex texture fetch: "
161                        + StringConverter::toString(hasCapability(RSC_VERTEX_TEXTURE_FETCH), true));
162                if (hasCapability(RSC_VERTEX_TEXTURE_FETCH))
163                {
164                        pLog->logMessage(
165                                "   - Max vertex textures: "
166                                        + StringConverter::toString(mNumVertexTextureUnits));
167                        pLog->logMessage(
168                                "   - Vertex textures shared: "
169                                + StringConverter::toString(mVertexTextureUnitsShared, true));
170
171                }
172
173
174    }
175};
Note: See TracBrowser for help on using the repository browser.