PixelLightAPI  .
Types.h
Go to the documentation of this file.
00001 /*********************************************************\
00002  *  File: Types.h                                        *
00003  *      Renderer types
00004  *
00005  *  Copyright (C) 2002-2012 The PixelLight Team (http://www.pixellight.org/)
00006  *
00007  *  This file is part of PixelLight.
00008  *
00009  *  PixelLight is free software: you can redistribute it and/or modify
00010  *  it under the terms of the GNU Lesser General Public License as published by
00011  *  the Free Software Foundation, either version 3 of the License, or
00012  *  (at your option) any later version.
00013  *
00014  *  PixelLight is distributed in the hope that it will be useful,
00015  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00017  *  GNU Lesser General Public License for more details.
00018  *
00019  *  You should have received a copy of the GNU Lesser General Public License
00020  *  along with PixelLight. If not, see <http://www.gnu.org/licenses/>.
00021 \*********************************************************/
00022 
00023 
00024 #ifndef __PLRENDERER_TYPES_H__
00025 #define __PLRENDERER_TYPES_H__
00026 #pragma once
00027 
00028 
00029 //[-------------------------------------------------------]
00030 //[ Includes                                              ]
00031 //[-------------------------------------------------------]
00032 #include <PLCore/Base/Rtti.h>
00033 #include <PLMath/Vector2i.h>
00034 
00035 
00036 //[-------------------------------------------------------]
00037 //[ Namespace                                             ]
00038 //[-------------------------------------------------------]
00039 namespace PLRenderer {
00040 
00041 
00042 //[-------------------------------------------------------]
00043 //[ Definitions                                           ]
00044 //[-------------------------------------------------------]
00045 /**
00046 *  @brief
00047 *    Clear flags
00048 */
00049 class Clear {
00050     public:
00051     enum Enum {
00052         Color   = 1<<0, /**< Clear color buffer */
00053         ZBuffer = 1<<1, /**< Clear z buffer */
00054         Stencil = 1<<2  /**< Clear stencil buffer */
00055     };
00056 };
00057 
00058 /**
00059 *  @brief
00060 *    Fill modes
00061 */
00062 class Fill {
00063     public:
00064     enum Enum {
00065         Point   = 0,    /**< Point fill mode */
00066         Line    = 1,    /**< Line fill mode */
00067         Solid   = 2,    /**< Solid fill mode */
00068         // End
00069         Number  = 3,    /**< Number of fill modes */
00070         Unknown = 4     /**< Unknown fill mode */
00071     };
00072     pl_enum(Enum)
00073         pl_enum_value(Point,    "Point fill mode")
00074         pl_enum_value(Line,     "Line fill mode")
00075         pl_enum_value(Solid,    "Solid fill mode")
00076         pl_enum_value(Unknown,  "Unknown fill mode")
00077     pl_enum_end
00078 };
00079 
00080 /**
00081 *  @brief
00082 *    Cull modes
00083 */
00084 class Cull {
00085     public:
00086     enum Enum {
00087         None    = 0,    /**< No culling */
00088         CW      = 1,    /**< Selects clockwise polygons as front-facing */
00089         CCW     = 2,    /**< Selects counterclockwise polygons as front-facing */
00090         // End
00091         Number  = 3,    /**< Number of cull modes */
00092         Unknown = 4     /**< Unknown cull mode */
00093     };
00094     pl_enum(Enum)
00095         pl_enum_value(None, "No culling")
00096         pl_enum_value(CW,   "Selects clockwise polygons as front-facing")
00097         pl_enum_value(CCW,  "Selects counterclockwise polygons as front-facing")
00098     pl_enum_end
00099 };
00100 
00101 /**
00102 *  @brief
00103 *    Blend modes
00104 */
00105 class BlendFunc {
00106     public:
00107     enum Enum {
00108         // Source & Destination
00109         Zero        = 0,    /**< Zero */
00110         One         = 1,    /**< One */
00111         // Source
00112         SrcColor    = 2,    /**< Source color */
00113         InvSrcColor = 3,    /**< Inverted src color */
00114         SrcAlpha    = 4,    /**< Source alpha */
00115         InvSrcAlpha = 5,    /**< Inverted source alpha */
00116         SrcAlphaSat = 6,    /**< Source alpha saturate */
00117         // Destination
00118         DstColor    = 7,    /**< Destination color */
00119         InvDstColor = 8,    /**< Inverted destination color */
00120         DstAlpha    = 9,    /**< Destination alpha */
00121         InvDstAlpha = 10,   /**< Inverted destination alpha */
00122         // End
00123         Number      = 11,   /**< Number of blend functions */
00124         Unknown     = 12    /**< Unknown blend function */
00125     };
00126     pl_enum(Enum)
00127         // Source & Destination
00128         pl_enum_value(Zero,         "Zero")
00129         pl_enum_value(One,          "One")
00130         // Source
00131         pl_enum_value(SrcColor,     "Source color")
00132         pl_enum_value(InvSrcColor,  "Inverted src color")
00133         pl_enum_value(SrcAlpha,     "Source alpha")
00134         pl_enum_value(InvSrcAlpha,  "Inverted source alpha")
00135         pl_enum_value(SrcAlphaSat,  "Source alpha saturate")
00136         // Destination
00137         pl_enum_value(DstColor,     "Destination color")
00138         pl_enum_value(InvDstColor,  "Inverted destination color")
00139         pl_enum_value(DstAlpha,     "Destination alpha")
00140         pl_enum_value(InvDstAlpha,  "Inverted destination alpha")
00141     pl_enum_end
00142 };
00143 
00144 /**
00145 *  @brief
00146 *    Comparison modes
00147 */
00148 class Compare {
00149     public:
00150     enum Enum {
00151         Never        = 0,   /**< Never passes */
00152         Less         = 1,   /**< Passes if the incoming value is less than the stored value */
00153         Equal        = 2,   /**< Passes if the incoming value is equal to the stored value */
00154         LessEqual    = 3,   /**< Passes if the incoming value is less than or equal to the stored value */
00155         Greater      = 4,   /**< Passes if the incoming value is greater than the stored value */
00156         NotEqual     = 5,   /**< Passes if the incoming value is not equal to the stored value */
00157         GreaterEqual = 6,   /**< Passes if the incoming value is greater than or equal to the stored value */
00158         Always       = 7,   /**< Always passes */
00159         // End
00160         Number       = 8,   /**< Number of comparison functions */
00161         Unknown      = 9    /**< Unknown comparison function */
00162     };
00163     pl_enum(Enum)
00164         pl_enum_value(Never,        "Never passes")
00165         pl_enum_value(Less,         "Passes if the incoming value is less than the stored value")
00166         pl_enum_value(Equal,        "Passes if the incoming value is equal to the stored value")
00167         pl_enum_value(LessEqual,    "Passes if the incoming value is less than or equal to the stored value")
00168         pl_enum_value(Greater,      "Passes if the incoming value is greater than the stored value")
00169         pl_enum_value(NotEqual,     "Passes if the incoming value is not equal to the stored value")
00170         pl_enum_value(GreaterEqual, "Passes if the incoming value is greater than or equal to the stored value")
00171         pl_enum_value(Always,       "Always passes")
00172     pl_enum_end
00173 };
00174 
00175 /**
00176 *  @brief
00177 *    Stencil operations
00178 */
00179 class StencilOp {
00180     public:
00181     enum Enum {
00182         Keep     = 0,   /**< Keeps the current value */
00183         Zero     = 1,   /**< Sets the stencil buffer value to zero */
00184         Replace  = 2,   /**< Sets the stencil buffer value to ref, as specified by RenderState::StencilRef */
00185         Incr     = 3,   /**< Increments the current stencil buffer value. Clamps to the maximum representable unsigned value. */
00186         Decr     = 4,   /**< Decrements the current stencil buffer value. Clamps to zero. */
00187         IncrWrap = 5,   /**< Increments the current stencil buffer value. Wraps the result. (See Capabilities::bStencilWrap) */
00188         DecrWrap = 6,   /**< Decrements the current stencil buffer value. Wraps the result. (See Capabilities::bStencilWrap) */
00189         Invert   = 7,   /**< Bitwise inverts the current stencil buffer value */
00190         // End
00191         Number   = 8,   /**< Number of stencil operations */
00192         Unknown  = 9    /**< Unknown stencil operation */
00193     };
00194     pl_enum(Enum)
00195         pl_enum_value(Keep,     "Keeps the current value")
00196         pl_enum_value(Zero,     "Sets the stencil buffer value to zero")
00197         pl_enum_value(Replace,  "Sets the stencil buffer value to ref, as specified by RenderState::StencilRef")
00198         pl_enum_value(Incr,     "Increments the current stencil buffer value. Clamps to the maximum representable unsigned value.")
00199         pl_enum_value(Decr,     "Decrements the current stencil buffer value. Clamps to zero.")
00200         pl_enum_value(IncrWrap, "Increments the current stencil buffer value. Wraps the result. (See Capabilities::bStencilWrap)")
00201         pl_enum_value(DecrWrap, "Decrements the current stencil buffer value. Wraps the result. (See Capabilities::bStencilWrap)")
00202         pl_enum_value(Invert,   "Bitwise inverts the current stencil buffer value")
00203     pl_enum_end
00204 };
00205 
00206 /**
00207 *  @brief
00208 *    Tessellation mode
00209 */
00210 class TessellationMode {
00211     public:
00212     enum Enum {
00213         Discrete   = 0, /**< Discrete mode (only integer tessellation factor) */
00214         Continuous = 1, /**< Continuous (floating point tessellation factor) */
00215         // End
00216         Number     = 2, /**< Number of tessellation modes */
00217         Unknown    = 3  /**< Unknown tessellation mode */
00218     };
00219     pl_enum(Enum)
00220         pl_enum_value(Discrete,     "Discrete mode (only integer tessellation factor)")
00221         pl_enum_value(Continuous,   "Continuous (floating point tessellation factor)")
00222     pl_enum_end
00223 };
00224 
00225 /**
00226 *  @brief
00227 *    Render states
00228 */
00229 class RenderState {
00230     public:
00231     enum Enum {
00232         // Modes
00233         FillMode            = 0,    /**< Fill mode (see Fill, default: Fill::Solid) */
00234         CullMode            = 1,    /**< Cull mode (see Cull, RenderState::InvCullMode, default: Cull::CCW) */
00235         // Z buffer
00236         ZEnable             = 2,    /**< Enable/disable z buffer test (false/true, default: true) */
00237         ZWriteEnable        = 3,    /**< Enable/disable z buffer writing (false/true, default: true) */
00238         ZFunc               = 4,    /**< Z buffer function (see Compare, default: Compare::LessEqual) */
00239         ZBias               = 5,    /**< Z bias/polygon offset factor, < 0 = towards camera (float to PLCore::uint32 example PLCore::Tools::FloatToUInt32(-0.001f), default: 0)
00240                                          Because RenderState::SlopeScaleDepthBias and RenderState::DepthBias below are API and
00241                                          GPU dependent, their results are NOT the same on each system & API. Whenever possible, do NOT use
00242                                          this 'classic' render states, use RenderState::ZBias instead. If this state is not null, the renderer
00243                                          will automatically manipulate the internal projection matrix to perform an 'z bias' which is more
00244                                          predictable as the 'classic' polygon offset. */
00245         SlopeScaleDepthBias = 6,    /**< Slope scale bias/polygon offset factor, try to avoid using this -> see ZBias (float to PLCore::uint32 example PLCore::Tools::FloatToUInt32(-1.0f), default: 0) */
00246         DepthBias           = 7,    /**< Depth bias/polygon offset units, try to avoid using this -> see ZBias (float to PLCore::uint32 example PLCore::Tools::FloatToUInt32(-2.0f), default: 0) */
00247         // Blend
00248         BlendEnable         = 8,    /**< Enable/disable blending (false/true, default: false) */
00249         SrcBlendFunc        = 9,    /**< Source blend function (see BlendFunc, default: BlendFunc::SrcAlpha) */
00250         DstBlendFunc        = 10,   /**< Destination blend function (see BlendFunc, default: BlendFunc::InvSrcAlpha) */
00251         // Stencil
00252         StencilEnable       = 11,   /**< Enable/disable stencil test (false/true, default: false) */
00253         StencilFunc         = 12,   /**< Stencil test passes if ((ref & mask) stencilfn (stencil & mask)) is true (see Compare, default: Compare::Always) */
00254         StencilRef          = 13,   /**< Reference value used in stencil test (PLCore::uint32, default: 0) */
00255         StencilMask         = 14,   /**< Mask value used in stencil test (PLCore::uint32, default: 0xFFFFFFFF) */
00256         StencilFail         = 15,   /**< Operation to perform if stencil test fails (StencilOp, default: StencilOp::Keep) */
00257         StencilZFail        = 16,   /**< Operation to perform if stencil test passes and Z test fails (StencilOp, default: StencilOp::Keep) */
00258         StencilPass         = 17,   /**< Operation to perform if both stencil and Z tests pass (StencilOp, default: StencilOp::Keep) */
00259         TwoSidedStencilMode = 18,   /**< Enable/disable 2 sided stenciling (false/true, default: false, requires Capabilities::bTwoSidedStencils)
00260                                          If the triangle winding order is clockwise, the Stencil* operations will be used. If the winding
00261                                          order is counterclockwise, the CCWStencil* operations will be used. */
00262         CCWStencilFunc      = 19,   /**< Stencil test passes if ((ref & mask) stencilfn (stencil & mask)) is true (see Compare, default: Compare::Always, requires Capabilities::bTwoSidedStencils) */
00263         CCWStencilFail      = 20,   /**< Operation to perform if ccw stencil test fails (StencilOp, default: StencilOp::Keep, requires Capabilities::bTwoSidedStencils) */
00264         CCWStencilZFail     = 21,   /**< Operation to perform if ccw stencil test passes and Z test fails (StencilOp, default: StencilOp::Keep, requires Capabilities::bTwoSidedStencils) */
00265         CCWStencilPass      = 22,   /**< Operation to perform if both ccw stencil and Z tests pass (StencilOp, default: StencilOp::Keep, requires Capabilities::bTwoSidedStencils) */
00266         // Point and line
00267         PointSize           = 23,   /**< Point size when it is not specified for each vertex. (float, default: 1.0)
00268                                          This value is in screen space units if RenderState::PointScaleEnable is false; otherwise this value is in world space units. */
00269         PointScaleEnable    = 24,   /**< Controls computation of size for point primitives. (false/true, default: false)
00270                                          When true, the point size is interpreted as a camera space value and is scaled by the distance function and the frustum
00271                                          to viewport y-axis scaling to compute the final screen-space point size. When false, the point size is interpreted as screen
00272                                          space and used directly. */
00273         PointSizeMin        = 25,   /**< Minimum size of point primitives (float, default: 1.0, requires Capabilities::bPointParameters) */
00274         PointSizeMax        = 26,   /**< Maximum size of point primitives, must be greater than or equal to PointSizeMin (float, default: 64.0, requires Capabilities::bPointParameters) */
00275         PointScaleA         = 27,   /**< Controls for distance-based size attenuation for point primitives (float, default: 1.0, requires Capabilities::bPointParameters) */
00276         PointScaleB         = 28,   /**< Controls for distance-based size attenuation for point primitives (float, default: 0.0, requires Capabilities::bPointParameters) */
00277         PointScaleC         = 29,   /**< Controls for distance-based size attenuation for point primitives (float, default: 0.0, requires Capabilities::bPointParameters) */
00278         LineWidth           = 30,   /**< Line width (float, default: 1.0) */
00279         // Tessellation
00280         TessellationFactor  = 31,   /**< Tessellation factor (1-Capabilities::nMaxTessellationFactor inclusive, default: 1, requires Capabilities::nMaxTessellationFactor > 1) */
00281         TessellationMode    = 32,   /**< Tessellation mode (default: TessellationMode::Discrete, requires Capabilities::nMaxTessellationFactor > 1) */
00282         // Misc
00283         PointSpriteEnable   = 33,   /**< When true, use point texture mapping (false/true, default: false, requires Capabilities::bPointSprite) */
00284         DitherEnable        = 34,   /**< Enable/disable dithering (false/true, default: false) */
00285         ScissorTestEnable   = 35,   /**< Enable/disable the scissor test (false/true, default: false) */
00286         MultisampleEnable   = 36,   /**< When true, perform multisample (false/true, default: true, requires Capabilities::nMultisampleAntialiasingSamples > 1, usually set automatically by the surfaces) */
00287         InvCullMode         = 37,   /**< Inverse cull mode active? RenderState::CullMode isn't touched only the intern API setting
00288                                          is inverted! (false/true, default: false) */
00289         FixedFillMode       = 38,   /**< General fill mode which is normally set once. If this isn't Fill::Unknown this fill mode
00290                                          will be used instead of RenderState::FillMode (see Fill, default: Fill::Unknown) */
00291         // End
00292         Number              = 39,   /**< Number of render states */
00293         Unknown             = 40    /**< Unknown render state */
00294     };
00295 };
00296 
00297 /**
00298 *  @brief
00299 *    Primitive types
00300 */
00301 class Primitive {
00302     public:
00303     enum Enum {
00304         PointList     = 0,  /**< Point list */
00305         LineList      = 1,  /**< Line list */
00306         LineStrip     = 2,  /**< Line strip */
00307         TriangleList  = 3,  /**< Triangle list */
00308         TriangleStrip = 4,  /**< Triangle strip */
00309         TriangleFan   = 5,  /**< Triangle fan */
00310         // End
00311         Number        = 7,  /**< Number of primitive types */
00312         Unknown       = 8   /**< Unknown primitive type */
00313     };
00314 };
00315 
00316 /**
00317 *  @brief
00318 *    Lock modes
00319 */
00320 class Lock {
00321     public:
00322     enum Enum {
00323         ReadOnly  = 0,  /**< Read only */
00324         WriteOnly = 1,  /**< Write only */
00325         ReadWrite = 2,  /**< Read and write */
00326         // End
00327         Number    = 3,  /**< Number of lock modes */
00328         Unknown   = 4   /**< Unknown lock mode */
00329     };
00330 };
00331 
00332 /**
00333 *  @brief
00334 *    Usage flags
00335 */
00336 class Usage {
00337     public:
00338     enum Enum {
00339         Static    = 0,  /**< Static memory usage */
00340         Dynamic   = 1,  /**< Dynamic memory usage */
00341         WriteOnly = 2,  /**< Informs the system that the application writes only to the buffer.
00342                              Using this flag enables the driver to choose the best memory location
00343                              for efficient write operations and rendering. */
00344         Software  = 3,  /**< Software memory usage (for instance temp buffers, normally no rendering possible) */
00345         // End
00346         Number    = 4,  /**< Number of usage flags */
00347         Unknown   = 5   /**< Unknown usage */
00348     };
00349 };
00350 
00351 /**
00352 *  @brief
00353 *    Texture addressing modes
00354 */
00355 class TextureAddressing {
00356     public:
00357     enum Enum {
00358         Clamp   = 0,    /**< Texture coordinates outside the range [0.0, 1.0] are set to the texture color at 0.0 or 1.0, respectively. */
00359         Border  = 1,    /**< Texture coordinates outside the range [0.0, 1.0] are set to the border color. */
00360         Wrap    = 2,    /**< Tile the texture at every integer junction. For example, for u values between 0 and 3, the texture is repeated three times; no mirroring is performed. */
00361         Mirror  = 3,    /**< Similar to Wrap, except that the texture is flipped at every integer junction. For u values between 0
00362                              and 1, for example, the texture is addressed normally; between 1 and 2, the texture is flipped (mirrored); between 2 and 3, the texture is normal again, and so on. */
00363         // End
00364         Number  = 4,    /**< Number of texture-addressing modes */
00365         Unknown = 5     /**< Unknown texture-addressing mode */
00366     };
00367     pl_enum(Enum)
00368         pl_enum_value(Clamp,    "Texture coordinates outside the range [0.0, 1.0] are set to the texture color at 0.0 or 1.0, respectively.")
00369         pl_enum_value(Border,   "Texture coordinates outside the range [0.0, 1.0] are set to the border color.")
00370         pl_enum_value(Wrap,     "Tile the texture at every integer junction. For example, for u values between 0 and 3, the texture is repeated three times; no mirroring is performed.")
00371         pl_enum_value(Mirror,   "Similar to Wrap, except that the texture is flipped at every integer junction")
00372     pl_enum_end
00373 };
00374 
00375 /**
00376 *  @brief
00377 *    Texture filtering modes
00378 *
00379 *  @note
00380 *    - Defines texture filtering modes for a texture stage
00381 */
00382 class TextureFiltering {
00383     public:
00384     enum Enum {
00385         None        = 0,    /**< Mipmapping disabled. The rasterizer should use the magnification filter instead. */
00386         Point       = 1,    /**< Point filtering used as a texture magnification or minification filter. The texel
00387                                  with coordinates nearest to the desired pixel value is used. The texture filter to
00388                                  be used between mipmap levels is nearest-point mipmap filtering. The rasterizer uses
00389                                  the color from the texel of the nearest mipmap texture. */
00390         Linear      = 2,    /**< Bilinear interpolation filtering used as a texture magnification or minification filter.
00391                                  A weighted average of a 2x2 area of texels surrounding the desired pixel is used. The
00392                                  texture filter to use between mipmap levels is trilinear mipmap interpolation. The
00393                                  rasterizer linearly interpolates pixel color, using the texels of the two nearest mipmap textures. */
00394         Anisotropic = 3,    /**< Anisotropic texture filtering used as a texture magnification or minification filter.
00395                                  Compensates for distortion caused by the difference in angle between the texture polygon
00396                                  and the plane of the screen. */
00397         // End
00398         Number      = 4,    /**< Number of texture filtering modes */
00399         Unknown     = 5     /**< Unknown texture filtering mode */
00400     };
00401     pl_enum(Enum)
00402         pl_enum_value(None,         "Mipmapping disabled. The rasterizer should use the magnification filter instead.")
00403         pl_enum_value(Point,        "Point filtering used as a texture magnification or minification filter")
00404         pl_enum_value(Linear,       "Bilinear interpolation filtering used as a texture magnification or minification filter")
00405         pl_enum_value(Anisotropic,  "Anisotropic texture filtering used as a texture magnification or minification filter")
00406     pl_enum_end
00407 };
00408 
00409 /**
00410 *  @brief
00411 *    Sampler states
00412 */
00413 class Sampler {
00414     public:
00415     enum Enum {
00416         // Address modes
00417         AddressU      =  0, /**< Texture-address mode for the u/s coordinate (TextureAddressing, default: TextureAddressing::Wrap) */
00418         AddressV      =  1, /**< Texture-address mode for the v/t coordinate (TextureAddressing, default: TextureAddressing::Wrap) */
00419         AddressW      =  2, /**< Texture-address mode for the w/r coordinate (TextureAddressing, default: TextureAddressing::Wrap) */
00420         // Filter
00421         MagFilter     =  3, /**< Magnification filter of type TextureFiltering (default: TextureFiltering::Linear) */
00422         MinFilter     =  4, /**< Minification filter of type TextureFiltering (default: TextureFiltering::Linear) */
00423         MipFilter     =  5, /**< Mipmap filter to use during minification. See TextureFiltering. (default: TextureFiltering::Linear) */
00424         // Misc
00425         MipmapLODBias =  6, /**< Mipmap level of detail (LOD) bias (float, default: 0.0) */
00426         MaxMapLevel   =  7, /**< LOD index of largest map to use. Values range from 0 to (n-1) where 0 is the largest. (PLCore::uint32, default: 1000) */
00427         MaxAnisotropy =  8, /**< Maximum anisotropy (PLCore::uint32, default: 1) */
00428         // End
00429         Number        =  9, /**< Number of sampler states */
00430         Unknown       = 10  /**< Unknown sampler state */
00431     };
00432 };
00433 
00434 
00435 //[-------------------------------------------------------]
00436 //[ Structures                                            ]
00437 //[-------------------------------------------------------]
00438 /**
00439 *  @brief
00440 *    Display mode
00441 */
00442 struct DisplayMode {
00443     PLMath::Vector2i vSize;         /**< Screen resolution */
00444     PLCore::uint32   nColorBits;    /**< Number of bits for the color (for example 32) */
00445     PLCore::uint32   nFrequency;    /**< Refresh rate (for example 60) */
00446 };
00447 
00448 /**
00449 *  @brief
00450 *    Holds all hardware capabilities
00451 */
00452 struct Capabilities {
00453     PLCore::uint32 nTotalAvailableGPUMemory;        /**< Total available GPU memory in kilobytes, 0 if it was not possible to determine this value, this value may not match your graphics card specification (e.g. "512 MiB" may get you "480 MiB" in here) */
00454     PLCore::uint8  nMaxColorRenderTargets;          /**< Maximum number of color render targets (multi render targets (MRT)) */
00455     PLCore::uint8  nMaxTextureUnits;                /**< Maximum number of texture units */
00456     PLCore::uint16 nMaxAnisotropy;                  /**< Maximum anisotropy */
00457     PLCore::uint8  nMaxTessellationFactor;          /**< Maximum tessellation factor (inclusive) */
00458     PLCore::uint16 nMaxTextureBufferSize;           /**< Maximum texture buffer size */
00459     bool           bTextureBufferNonPowerOfTwo;     /**< Non power of two (NPOT) texture buffers supported? (no power of two restriction for all texture buffer types) */
00460     bool           bTextureBuffer2DArray;           /**< 2D array texture buffers supported? */
00461     PLCore::uint16 nMaxTextureBuffer2DArrayLayers;  /**< Maximum number of 2D array texture layers */
00462     bool           bTextureBufferRectangle;         /**< Rectangle texture buffers supported? (special non power of two texture buffer type, comes with special limitations) */
00463     PLCore::uint16 nMaxRectangleTextureBufferSize;  /**< Maximum rectangle texture buffer size */
00464     bool           bTextureBuffer3D;                /**< 3D texture buffers supported? */
00465     PLCore::uint16 nMax3DTextureBufferSize;         /**< Maximum 3D texture buffer size */
00466     bool           bTextureBufferCube;              /**< Cube texture buffers supported? */
00467     PLCore::uint16 nMaxCubeTextureBufferSize;       /**< Maximum cube texture buffer size */
00468     bool           bStencilWrap;                    /**< Stencil wrap supported? (for StencilOp::IncrWrap & StencilOp::DecrWrap) */
00469     bool           bTwoSidedStencils;               /**< Two sided stencils supported? (for RenderState::TwoSidedStencilMode, RenderState::CCWStencilFunc,
00470                                                          RenderState::CCWStencilFail, RenderState::CCWStencilZFail, RenderState::CCWStencilPass) */
00471     bool           bDepthBoundsTest;                /**< Depth bounds test supported? (for Renderer::SetDepthBounds()) */
00472     bool           bPointSprite;                    /**< Point sprite supported? (for RenderState::PointSpriteEnable) */
00473     bool           bPointParameters;                /**< Point parameters supported? (for RenderState::PointSizeMin, RenderState::PointSizeMax,
00474                                                          RenderState::PointScaleA, RenderState::PointScaleB, RenderState::PointScaleC) */
00475     bool           bOcclusionQuery;                 /**< Occlusion query supported? (for the OcclusionQuery class) */
00476     bool           bVertexBufferSecondaryColor;     /**< Vertex buffer secondary color supported? (for the second channel of VertexBuffer::Color) */
00477     PLCore::uint32 nZBufferBits;                    /**< Z buffer bits (for example 24) */
00478     PLCore::uint32 nStencilBits;                    /**< Stencil buffer bits (for example 8) */
00479     PLCore::uint32 nMultisampleAntialiasingSamples; /**< Multisample antialiasing samples */
00480 };
00481 
00482 /**
00483 *  @brief
00484 *    Renderer statistics
00485 */
00486 struct Statistics {
00487     PLCore::uint32 nRenderStateChanges;         /**< Number of render (internal API) state changes */
00488     PLCore::uint32 nSamplerStateChanges;        /**< Number of sampler (internal API) state changes */
00489     PLCore::uint32 nDrawPrimitivCalls;          /**< Number of draw primitive calls */
00490     PLCore::uint32 nVertices;                   /**< Number of rendered vertices */
00491     PLCore::uint32 nTriangles;                  /**< Number of rendered triangles */
00492     float          fRenderingTime;              /**< Total rendering time in milliseconds */
00493     // Texture buffers
00494     PLCore::uint32 nTextureBuffersNum;          /**< Number of texture buffers */
00495     PLCore::uint64 nTextureBuffersMem;          /**< Memory in bytes the texture buffers require */
00496     PLCore::uint32 nTextureBufferBinds;         /**< Number of texture buffer bindings */
00497     // Vertex buffers
00498     PLCore::uint32 nVertexBufferNum;            /**< Number of vertex buffers */
00499     PLCore::uint64 nVertexBufferMem;            /**< Memory in bytes the vertex buffers require */
00500     PLCore::uint64 nVertexBuffersSetupTime;     /**< Vertex buffers setup time (microseconds) */
00501     PLCore::uint32 nVertexBufferLocks;          /**< Number of vertex buffer locks */
00502     // Index buffers
00503     PLCore::uint32 nIndexBufferNum;             /**< Number of index buffers */
00504     PLCore::uint64 nIndexBufferMem;             /**< Memory in bytes the index buffers require */
00505     PLCore::uint64 nIndexBuffersSetupTime;      /**< Index buffers setup time (microseconds) */
00506     PLCore::uint32 nIndexBufferLocks;           /**< Number of index buffer locks */
00507     // Uniform buffers
00508     PLCore::uint32 nUniformBufferNum;           /**< Number of uniform buffers */
00509     PLCore::uint64 nUniformBufferMem;           /**< Memory in bytes the uniform buffers require */
00510     PLCore::uint64 nUniformBuffersSetupTime;    /**< Uniform buffers setup time (microseconds) */
00511     PLCore::uint32 nUniformBufferLocks;         /**< Number of uniform buffer locks */
00512 };
00513 
00514 
00515 //[-------------------------------------------------------]
00516 //[ Namespace                                             ]
00517 //[-------------------------------------------------------]
00518 } // PLRenderer
00519 
00520 
00521 #endif // __PLRENDERER_TYPES_H__


PixelLight PixelLight 0.9.11-R1
Copyright (C) 2002-2012 by The PixelLight Team
Last modified Thu Feb 23 2012 14:09:01
The content of this PixelLight document is published under the
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported