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_shadow: boolean;`
| `EXT_texture_filter_anisotropic: boolean;`
| `NV_multisample_filter_hint: boolean;`
| `ARB_occlusion_query: boolean;`
| `EXT_fog_coord: boolean;`
| `ARB_window_pos: boolean;`
| `MESA_window_pos: boolean;`
| `CLAMP_TO_EDGE: TGLenum;`
| `MaxTextureSize: Cardinal;`
| `MaxLights: Cardinal;`
| `MaxCubeMapTextureSize: Cardinal;`
| `MaxTexture3DSize: Cardinal;`
| `MaxTextureMaxAnisotropyEXT: Single;`
| `QueryCounterBits: TGLint;`
| `MaxRenderbufferSize: TGLuint;`
| `MaxClipPlanes: Cardinal;`
| `Multisample: boolean;`
| `MaxTextureUnits: Cardinal;`
| `UseMultiTexturing: boolean;`
| `Texture3D: TGLSupport;`
| `Framebuffer: TGLSupport;`
| `FBOMultiSampling: boolean;`
| `CurrentMultiSampling: Cardinal;`
| `PackedDepthStencil: boolean;`
| `ShadowVolumesPossible: boolean;`
| `TextureNonPowerOfTwo: boolean;`
| `TextureCubeMap: TGLSupport;`
| `TextureCompression: TGPUCompressions;`
| `VertexBufferObject: boolean;`
| `BlendConstant: boolean;`
| `TextureFloat: boolean;`
| `TextureDepth: boolean;`
### Methods
| `constructor Create;`
## Description ### Fields
| `Version_1_2: boolean;`
OpenGL versions supported. Checked by looking at GL version string and by checking whether actual entry points are available. This is important because bad OpenGL implementations (like the horrible ATI Linux closed drivers) sometimes lie, claiming support in the GL version string but actually lacking proper function entry points. We check the actual presence of entry points (GLExt.Load_GL_version_x_x do that). We *also* check version string (TGLVersion.AtLeast), since OpenGL may have some buggy entry point in case of work-in-progress features (not yet advertised in GL version string), e.g. Mesa 6.x had such buggy glStencilOpSeparate. This is correct OpenGL behavior AFAIK, and we handle it.
| `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_shadow: 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.
| `EXT_texture_filter_anisotropic: boolean;`
| `NV_multisample_filter_hint: boolean;`
| `ARB_occlusion_query: boolean;`
| `EXT_fog_coord: boolean;`
| `ARB_window_pos: boolean;`
| `MESA_window_pos: 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;`
| `MaxCubeMapTextureSize: Cardinal;`
| `MaxTexture3DSize: Cardinal;`
| `MaxTextureMaxAnisotropyEXT: Single;`
| `QueryCounterBits: TGLint;`
| `MaxRenderbufferSize: TGLuint;`
| `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.
| `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 TCastleWindowCustom.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: TGLSupport;`
Are cubemaps supported. gsExtension means GL_ARB_texture_cube_map on core OpenGL. gsStandard means standard feature of OpenGL or OpenGL ES. Since the constants defined by ARB_texture_cube_map were promoted to core with the same values, the distinction between gsExtension and gsStandard in practice doesn't exist.
| `TextureCompression: TGPUCompressions;`
Which texture compression formats are supported.
| `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.
| `TextureDepth: boolean;`
Support for depth texture formats for glTexImage2d.
### Methods
| `constructor Create;`
Generated by PasDoc 0.13.0 on 2015-06-15 04:43:10