Support Forum       G3D Web Page     
Public Types | Static Public Member Functions | List of all members
G3D::GLCaps Class Reference


Low-level wrapper for OpenGL extension management. More...

Public Types

enum  Vendor {
  ATI,
  AMD = ATI,
  NVIDIA,
  MESA,
  INTEL,
  ARB
}
 

Static Public Member Functions

static OSWindow::Settings::API api ()
 
static const StringdriverVersion ()
 
static Vendor enumVendor ()
 
static const class ImageFormatfirstSupportedTexture (const Array< const class ImageFormat *> &prefs)
 Returns the first element of prefs for which supportsTexture() returns true. More...
 
static void getExtensions (Array< String > &extensions)
 Fills the array with the currently available extension names. More...
 
static float glslVersion ()
 e.g., 1.50 or 4.00 More...
 
static const StringglVersion ()
 
static float glVersionNumber ()
 
static bool hasBug_R11G11B10F ()
 Some ATI cards claim to support ImageFormat::R11G10B10F but render to it incorrectly. More...
 
static void init (OSWindow::Settings::API api=OSWindow::Settings::API::API_OPENGL)
 Loads OpenGL extensions (e.g. More...
 
static int maxCubeMapSize ()
 
static int maxTextureBufferSize ()
 
static int maxTextureSize ()
 
static int numTextureCoords ()
 Between 8 and 16 on most cards. More...
 
static int numTextures ()
 Between 16 and 32 on most cards. More...
 
static int numTextureUnits ()
 4 on most cards. More...
 
static const Stringrenderer ()
 
static const class ImageFormatsmallHDRFormat ()
 Returns a small high-dynamic range (float) RGB format supported on this machine. More...
 
static bool supports (const String &extName)
 
static bool supports_GL_ARB_fragment_program ()
 
static bool supports_GL_ARB_fragment_shader ()
 
static bool supports_GL_ARB_framebuffer_object ()
 
static bool supports_GL_ARB_framebuffer_sRGB ()
 
static bool supports_GL_ARB_multitexture ()
 
static bool supports_GL_ARB_shader_objects ()
 
static bool supports_GL_ARB_shading_language_100 ()
 
static bool supports_GL_ARB_shadow ()
 
static bool supports_GL_ARB_sync ()
 
static bool supports_GL_ARB_texture_border_clamp ()
 
static bool supports_GL_ARB_texture_buffer_object ()
 
static bool supports_GL_ARB_texture_float ()
 
static bool supports_GL_ARB_texture_non_power_of_two ()
 
static bool supports_GL_ARB_vertex_buffer_object ()
 
static bool supports_GL_ARB_vertex_program ()
 
static bool supports_GL_ARB_vertex_shader ()
 
static bool supports_GL_ATI_separate_stencil ()
 
static bool supports_GL_EXT_framebuffer_object ()
 
static bool supports_GL_EXT_geometry_shader4 ()
 
static bool supports_GL_EXT_separate_specular_color ()
 
static bool supports_GL_EXT_stencil_two_side ()
 
static bool supports_GL_EXT_stencil_wrap ()
 
static bool supports_GL_EXT_texture3D ()
 
static bool supports_GL_EXT_texture_compression_s3tc ()
 
static bool supports_GL_EXT_texture_cube_map ()
 
static bool supports_GL_EXT_texture_edge_clamp ()
 
static bool supports_GL_EXT_texture_mirror_clamp ()
 
static bool supports_GL_EXT_texture_rectangle ()
 
static bool supports_GL_NV_fence ()
 
static bool supports_GL_NV_vertex_program2 ()
 
static bool supports_GL_SGIS_generate_mipmap ()
 
static bool supports_glTexStorage2D ()
 
static bool supportsG3D10 (String &explanation)
 Returns true if this GPU/driver supports the features needed for the G3D 10 release, which raises the minimum standards for GPUs. More...
 
static bool supportsTexture (const class ImageFormat *fmt)
 Returns true if the given texture format is supported on this device for Textures. More...
 
static bool supportsTextureDrawBuffer (const class ImageFormat *fmt)
 Returns true if the given texture format is supported on this device for draw FrameBuffers. More...
 
static const Stringvendor ()
 

Detailed Description


Low-level wrapper for OpenGL extension management.

Can be used without G3D::RenderDevice to load and manage extensions.

OpenGL has a base API and an extension API. All OpenGL drivers must support the base API. The latest features may not be supported by some drivers, so they are in the extension API and are dynamically loaded at runtime using GLCaps::loadExtensions.
Before using a specific extension you must test for its presence using the GLCaps::supports method.

For convenience, frequently used extensions have fast tests, e.g., GLCaps::supports_GL_EXT_texture_rectangle.

Note that GL_NV_texture_rectangle and GL_EXT_texture_rectangle have exactly the same constants, so supports_GL_EXT_texture_rectangle returns true if either is supported.

GLCaps assumes all OpenGL contexts have the same capabilities.

The following extensions are shortcutted with a method named similarly to GLCaps::supports_GL_EXT_texture_rectangle():

These methods do not appear in the documentation because they are generated using macros.

The hasBug_ methods detect specific common bugs on graphics cards. They can be used to switch to fallback rendering paths.

Member Enumeration Documentation

◆ Vendor

Enumerator
ATI 
AMD 
NVIDIA 
MESA 
INTEL 
ARB 

Member Function Documentation

◆ api()

static OSWindow::Settings::API G3D::GLCaps::api ( )
inlinestatic

◆ driverVersion()

static const String& G3D::GLCaps::driverVersion ( )
static

◆ enumVendor()

static Vendor G3D::GLCaps::enumVendor ( )
static

◆ firstSupportedTexture()

static const class ImageFormat* G3D::GLCaps::firstSupportedTexture ( const Array< const class ImageFormat *> &  prefs)
static

Returns the first element of prefs for which supportsTexture() returns true.

Returns nullptr if none are supported.

◆ getExtensions()

static void G3D::GLCaps::getExtensions ( Array< String > &  extensions)
static

Fills the array with the currently available extension names.

◆ glslVersion()

static float G3D::GLCaps::glslVersion ( )
inlinestatic

e.g., 1.50 or 4.00

◆ glVersion()

static const String& G3D::GLCaps::glVersion ( )
static

◆ glVersionNumber()

static float G3D::GLCaps::glVersionNumber ( )
static

◆ hasBug_R11G11B10F()

static bool G3D::GLCaps::hasBug_R11G11B10F ( )
static

Some ATI cards claim to support ImageFormat::R11G10B10F but render to it incorrectly.

◆ init()

static void G3D::GLCaps::init ( OSWindow::Settings::API  api = OSWindow::Settings::API::API_OPENGL)
static

Loads OpenGL extensions (e.g.

glBindBufferARB). Call this once at the beginning of the program, after a video device is created. This is called for you if you use G3D::RenderDevice.

◆ maxCubeMapSize()

static int G3D::GLCaps::maxCubeMapSize ( )
inlinestatic

◆ maxTextureBufferSize()

static int G3D::GLCaps::maxTextureBufferSize ( )
inlinestatic

◆ maxTextureSize()

static int G3D::GLCaps::maxTextureSize ( )
inlinestatic

◆ numTextureCoords()

static int G3D::GLCaps::numTextureCoords ( )
inlinestatic

Between 8 and 16 on most cards.

Can be more than number of textures.

◆ numTextures()

static int G3D::GLCaps::numTextures ( )
inlinestatic

Between 16 and 32 on most cards.

Can be more than number of fixed-function texture units.

◆ numTextureUnits()

static int G3D::GLCaps::numTextureUnits ( )
inlinestatic

4 on most cards.

Only affects fixed function. See http://developer.nvidia.com/object/General_FAQ.html#t6 for a discussion of the number of texture units.

◆ renderer()

static const String& G3D::GLCaps::renderer ( )
static

◆ smallHDRFormat()

static const class ImageFormat* G3D::GLCaps::smallHDRFormat ( )
static

Returns a small high-dynamic range (float) RGB format supported on this machine.

Prefers: R11G11B10F, RGB16F, RGB32F

◆ supports()

static bool G3D::GLCaps::supports ( const String extName)
static

◆ supports_GL_ARB_fragment_program()

static bool G3D::GLCaps::supports_GL_ARB_fragment_program ( )
inlinestatic

◆ supports_GL_ARB_fragment_shader()

static bool G3D::GLCaps::supports_GL_ARB_fragment_shader ( )
inlinestatic

◆ supports_GL_ARB_framebuffer_object()

static bool G3D::GLCaps::supports_GL_ARB_framebuffer_object ( )
inlinestatic

◆ supports_GL_ARB_framebuffer_sRGB()

static bool G3D::GLCaps::supports_GL_ARB_framebuffer_sRGB ( )
inlinestatic

◆ supports_GL_ARB_multitexture()

static bool G3D::GLCaps::supports_GL_ARB_multitexture ( )
inlinestatic

◆ supports_GL_ARB_shader_objects()

static bool G3D::GLCaps::supports_GL_ARB_shader_objects ( )
inlinestatic

◆ supports_GL_ARB_shading_language_100()

static bool G3D::GLCaps::supports_GL_ARB_shading_language_100 ( )
inlinestatic

◆ supports_GL_ARB_shadow()

static bool G3D::GLCaps::supports_GL_ARB_shadow ( )
inlinestatic

◆ supports_GL_ARB_sync()

static bool G3D::GLCaps::supports_GL_ARB_sync ( )
inlinestatic

◆ supports_GL_ARB_texture_border_clamp()

static bool G3D::GLCaps::supports_GL_ARB_texture_border_clamp ( )
inlinestatic

◆ supports_GL_ARB_texture_buffer_object()

static bool G3D::GLCaps::supports_GL_ARB_texture_buffer_object ( )
inlinestatic

◆ supports_GL_ARB_texture_float()

static bool G3D::GLCaps::supports_GL_ARB_texture_float ( )
inlinestatic

◆ supports_GL_ARB_texture_non_power_of_two()

static bool G3D::GLCaps::supports_GL_ARB_texture_non_power_of_two ( )
inlinestatic

◆ supports_GL_ARB_vertex_buffer_object()

static bool G3D::GLCaps::supports_GL_ARB_vertex_buffer_object ( )
inlinestatic

◆ supports_GL_ARB_vertex_program()

static bool G3D::GLCaps::supports_GL_ARB_vertex_program ( )
inlinestatic

◆ supports_GL_ARB_vertex_shader()

static bool G3D::GLCaps::supports_GL_ARB_vertex_shader ( )
inlinestatic

◆ supports_GL_ATI_separate_stencil()

static bool G3D::GLCaps::supports_GL_ATI_separate_stencil ( )
inlinestatic

◆ supports_GL_EXT_framebuffer_object()

static bool G3D::GLCaps::supports_GL_EXT_framebuffer_object ( )
inlinestatic

◆ supports_GL_EXT_geometry_shader4()

static bool G3D::GLCaps::supports_GL_EXT_geometry_shader4 ( )
inlinestatic

◆ supports_GL_EXT_separate_specular_color()

static bool G3D::GLCaps::supports_GL_EXT_separate_specular_color ( )
inlinestatic

◆ supports_GL_EXT_stencil_two_side()

static bool G3D::GLCaps::supports_GL_EXT_stencil_two_side ( )
inlinestatic

◆ supports_GL_EXT_stencil_wrap()

static bool G3D::GLCaps::supports_GL_EXT_stencil_wrap ( )
inlinestatic

◆ supports_GL_EXT_texture3D()

static bool G3D::GLCaps::supports_GL_EXT_texture3D ( )
inlinestatic

◆ supports_GL_EXT_texture_compression_s3tc()

static bool G3D::GLCaps::supports_GL_EXT_texture_compression_s3tc ( )
inlinestatic

◆ supports_GL_EXT_texture_cube_map()

static bool G3D::GLCaps::supports_GL_EXT_texture_cube_map ( )
inlinestatic

◆ supports_GL_EXT_texture_edge_clamp()

static bool G3D::GLCaps::supports_GL_EXT_texture_edge_clamp ( )
inlinestatic

◆ supports_GL_EXT_texture_mirror_clamp()

static bool G3D::GLCaps::supports_GL_EXT_texture_mirror_clamp ( )
inlinestatic

◆ supports_GL_EXT_texture_rectangle()

static bool G3D::GLCaps::supports_GL_EXT_texture_rectangle ( )
inlinestatic

◆ supports_GL_NV_fence()

static bool G3D::GLCaps::supports_GL_NV_fence ( )
inlinestatic

◆ supports_GL_NV_vertex_program2()

static bool G3D::GLCaps::supports_GL_NV_vertex_program2 ( )
inlinestatic

◆ supports_GL_SGIS_generate_mipmap()

static bool G3D::GLCaps::supports_GL_SGIS_generate_mipmap ( )
inlinestatic

◆ supports_glTexStorage2D()

static bool G3D::GLCaps::supports_glTexStorage2D ( )
static

◆ supportsG3D10()

static bool G3D::GLCaps::supportsG3D10 ( String explanation)
static

Returns true if this GPU/driver supports the features needed for the G3D 10 release, which raises the minimum standards for GPUs.

This call is intended to give developers some guidance in what to expect from the new API, however, it is not guaranteed to match the G3D 10.xx specification and requirements because that API is still under design.

Parameters
explanationDetailed explanation of which extensions are needed.

◆ supportsTexture()

static bool G3D::GLCaps::supportsTexture ( const class ImageFormat fmt)
static

Returns true if the given texture format is supported on this device for Textures.

◆ supportsTextureDrawBuffer()

static bool G3D::GLCaps::supportsTextureDrawBuffer ( const class ImageFormat fmt)
static

Returns true if the given texture format is supported on this device for draw FrameBuffers.

Note: always false for depth compressed formats

◆ vendor()

static const String& G3D::GLCaps::vendor ( )
static

documentation generated on Wed Nov 24 2021 08:01:56 using doxygen 1.8.15