Castle Game Engine: CastleGLUtils: Class TGLFeatures

# Class TGLFeatures
Description | Hierarchy | Fields | Methods | Properties
## Unit CastleGLUtils ## Declaration `type TGLFeatures = class(TObject)` ## Description OpenGL features, analyzed based on OpenGL extensions and version. A single instance of this class is assigned to GLFeatures after the first OpenGL context was created. If you have multiple OpenGL contexts, our engine assumes they share resources and have equal features. ## Hierarchy TObject TGLFeatures ## Overview ### Fields
| `Version_1_2: boolean;`
| `Version_1_3: boolean;`
| `Version_1_4: boolean;`
| `Version_1_5: boolean;`
| `Version_2_0: boolean;`
| `Version_2_1: boolean;`
| `Version_3_0: boolean;`
| `Version_3_1: boolean;`
| `Version_3_2: boolean;`
| `Version_3_3: boolean;`
| `Version_4_0: boolean;`
| `ARB_depth_texture: boolean;`
| `ARB_shadow: boolean;`
| `EXT_fog_coord: boolean;`
| `EXT_texture_filter_anisotropic: boolean;`
| `NV_multisample_filter_hint: boolean;`
| `ARB_occlusion_query: boolean;`
| `CLAMP_TO_EDGE: TGLenum;`
| `MaxTextureSize: Cardinal;`
| `MaxLights: Cardinal;`
| `MaxCubeMapTextureSizeARB: Cardinal;`
| `MaxTexture3DSize: Cardinal;`
| `MaxTextureMaxAnisotropyEXT: Single;`
| `QueryCounterBits: TGLint;`
| `MaxRenderbufferSize: TGLuint;`
| `MaxRectangleTextureSize: Cardinal;`
| `MaxClipPlanes: Cardinal;`
| `Multisample: boolean;`
| `MaxTextureUnits: Cardinal;`
| `UseMultiTexturing: boolean;`
| `Texture3D: TGLSupport;`
| `TextureRectangle: boolean;`
| `Framebuffer: TGLSupport;`
| `FBOMultiSampling: boolean;`
| `CurrentMultiSampling: Cardinal;`
| `PackedDepthStencil: boolean;`
| `ShadowVolumesPossible: boolean;`
| `TextureNonPowerOfTwo: boolean;`
| `TextureCubeMap: boolean;`
| `TextureCompressionS3TC: boolean;`
| `VertexBufferObject: boolean;`
| `BlendConstant: boolean;`
| `TextureFloat: boolean;`
### Methods
| `constructor Create;`
## Description ### Fields
| `Version_1_2: boolean;`
TODO: this should not even be defined for OpenGLES, since it's always false, OpenGL ES versions are different.
| `Version_1_3: boolean;`
| `Version_1_4: boolean;`
| `Version_1_5: boolean;`
| `Version_2_0: boolean;`
| `Version_2_1: boolean;`
| `Version_3_0: boolean;`
| `Version_3_1: boolean;`
| `Version_3_2: boolean;`
| `Version_3_3: boolean;`
| `Version_4_0: boolean;`
| `ARB_depth_texture: boolean;`
Is the extension below loaded. Note: we prefer to avoid exposing directly each extension presence like below. Instead most interesting extensions are wrapped in "features" like UseMultiTexturing, see lower.
| `ARB_shadow: boolean;`
| `EXT_fog_coord: boolean;`
| `EXT_texture_filter_anisotropic: boolean;`
| `NV_multisample_filter_hint: boolean;`
| `ARB_occlusion_query: boolean;`
| `CLAMP_TO_EDGE: TGLenum;`
GL_CLAMP_TO_EDGE, if available in current OpenGL version. Otherwise GL_CLAMP. Use this (insteaf of direct GL_CLAMP_TO_EDGE) to work with really ancient OpenGL versions before 1.2. Note that our engine officially supports only OpenGL >= 1.2, so don't expect everything to work smootly with such ancient OpenGL anyway!
| `MaxTextureSize: Cardinal;`
Constant (for given context) OpenGL limits. Initialized to 0 if appropriate OpenGL functionality is not available.
| `MaxLights: Cardinal;`
| `MaxCubeMapTextureSizeARB: Cardinal;`
| `MaxTexture3DSize: Cardinal;`
| `MaxTextureMaxAnisotropyEXT: Single;`
| `QueryCounterBits: TGLint;`
| `MaxRenderbufferSize: TGLuint;`
| `MaxRectangleTextureSize: Cardinal;`
| `MaxClipPlanes: Cardinal;`
| `Multisample: boolean;`
| `MaxTextureUnits: Cardinal;`
Number of texture units available. Equal to glGetInteger(GL_MAX_TEXTURE_UNITS), if multi-texturing available. Equal to 1 (OpenGL supports always 1 texture) otherwise.
| `UseMultiTexturing: boolean;`
Are all OpenGL multi-texturing extensions for VRML/X3D MultiTexture support available. This used to check a couple of multitexturing extensions, like ARB_multitexture. Right now, it simply checks for OpenGL 1.3 version. It is supported by virtually all existing GPUs. So it's acceptable to just check it, and write your code for 1.3, and eventual fallback code (when this is false) write only for really ancient GPUs.
| `Texture3D: TGLSupport;`
Are 3D textures supported by OpenGL. If they are, note that GL_TEXTURE_3D and GL_TEXTURE_3D_EXT are equal, so often both `Texture3D` = gsStandard and `Texture3D` = gsExtension cases may be handled by the same code.
| `TextureRectangle: boolean;`
| `Framebuffer: TGLSupport;`
Is `Framebuffer` supported. Value gsExtension means that EXT_framebuffer_object is used, gsStandard means that ARB_framebuffer_object (which is a "core extesion", present the same way in OpenGL 3 core, also in OpenGL ES >= 2.0 core) is available.
| `FBOMultiSampling: boolean;`
Is multisampling possible for FBO buffers and textures. Although these are two orthogonal features of OpenGL, in practice you want to use multisample for both FBO buffers and textures, or for none — otherwise, FBO can not be initialized correctly when you mix various multisample settings.
| `CurrentMultiSampling: Cardinal;`
How multi-sampling was initialized for this OpenGL context. Value = 1 means that no multi-sampling is initialized. Values > 1 mean that you have multi-sampling, with given number of samples per pixel. Contrast this with TCastleWindowBase.MultiSampling or TOpenGLControl.MultiSampling, that say how many samples you wanted to get.
| `PackedDepthStencil: boolean;`
Does OpenGL context have depth buffer packed with stencil buffer. See EXT_packed_depth_stencil extension for explanation. This is important for FBOs, as the depth/stencil have to be set up differently depending on `PackedDepthStencil` value. This is also important for all code using TGLRenderToTexture with TGLRenderToTexture.Buffer equal tbDepth or tbColorAndDepth: your depth texture must be prepared differently, to include both depth+stencil data, to work. For now, this is simply equal to GL_EXT_packed_depth_stencil. (TODO: for core OpenGL 3, how to detect should we use packed version? http://www.opengl.org/registry/specs/ARB/framebuffer_object.txt incorporates EXT_packed_depth_stencil, so forward-compatible contexts do not need to declare it. Should we assume that forward-compatible gl 3 contexts always have depth/stencil packed?)
| `ShadowVolumesPossible: boolean;`
Does OpenGL context support shadow volumes. This simply checks do we have stencil buffer with at least 4 bits for now.
| `TextureNonPowerOfTwo: boolean;`
Are non-power-of-2 textures supported.
| `TextureCubeMap: boolean;`
Are cubemaps supported. This means support for GL_ARB_texture_cube_map.
| `TextureCompressionS3TC: boolean;`
Texture S3TC compression support. This means you can load textures by glCompressedTexImage2DARB and use GL_COMPRESSED_*_S3TC_*_EXT enums.
| `VertexBufferObject: boolean;`
VBO support (in OpenGL (ES) core).
| `BlendConstant: boolean;`
glBlendColor and GL_CONSTANT_ALPHA support.
| `TextureFloat: boolean;`
Support for float texture formats for glTexImage2d.
### Methods
| `constructor Create;`
Generated by PasDoc 0.13.0 on 2013-08-17 21:27:12