Skip to content

GlCapabilities

final class GlCapabilities
Package: dev.joid.base.opengl.capability · Module: base-opengl · Source: GlCapabilities.java
Backends: LWJGL 2 LWJGL 3

What the current OpenGL context offers, read once when the render bridge is created: versions, profile, extensions and limits.

GlRenderBridge picks one path per feature from it: GLSL dialect, framebuffer family, vertex arrays, mipmap builder.

ReturnsSignatureSummary
GlCapabilitiesread(IGlBinding binding) factoryReads the capabilities of the current context.

ReturnsSignatureSummary
booleanhasExtension(String name)If true, the context lists that extension, such as "GL_ARB_sampler_objects".
booleanhasDepthClamp()If true, the context has depth clamping (OpenGL 3.2 or GL_ARB_depth_clamp), which the state guard turns off for JOID.
booleanhasVertexArrays()If true, the context has vertex array objects (OpenGL 3.0 or GL_ARB_vertex_array_object).
booleanhasPixelBuffers()If true, the context has pixel buffer objects (OpenGL 2.1 or an extension).
booleanhasSamplerObjects()If true, the context has sampler objects (OpenGL 3.3 or GL_ARB_sampler_objects): the bridge unbinds the sampler of each unit it uses.
booleanhasFrameBufferSrgb()If true, the context has sRGB framebuffers (OpenGL 3.0 or an extension), which the state guard turns off for JOID.
booleanhasFrameBufferBlit()If true, the context can blit framebuffers: core framebuffers or GL_EXT_framebuffer_blit.
booleanhasPrimitiveRestart()If true, the context has primitive restart (OpenGL 3.1), which the state guard turns off for JOID.
booleanhasRasterizerDiscard()If true, the context has rasterizer discard (OpenGL 3.0), which the state guard turns off for JOID.
StringgetName()Returns a readable name of the context, such as OpenGL 3.3 with GLSL 3.30 (renderer), which the messages of JOID quote.
GlslDialectgetDialect()Returns the highest desktop GLSL dialect of the context, up to GLSL 3.30; at least GLSL 1.20.
GlFrameBufferFamilygetFrameBufferFamily()Returns CORE for OpenGL 3.0 or GL_ARB_framebuffer_object, EXT for GL_EXT_framebuffer_object, UNSUPPORTED otherwise.
intgetVersion()Returns the OpenGL version times 100, such as 330 for 3.3.
intgetGlslVersion()Returns the GLSL version times 100, such as 330 for 3.30.
GlProfilegetProfile()Returns the profile of the context.
StringgetRenderer()Returns the renderer string of the driver.
Set<String>getExtensionSet()Returns the extensions of the context, read-only.
intgetMaxTextureSize()Returns the largest width and height of a texture, in pixels.
ReturnsSignatureSummary
thisrequire() fluentReturns the capabilities when JOID can draw with them.

GlCapabilities read(IGlBinding binding) factory

Throws:

  • IllegalStateException: No OpenGL context is current: create the context of JOID and make it current before registering the backend

Reads the capabilities of the current context. Throws an IllegalStateException when no OpenGL context is current on the calling thread.

boolean hasExtension(String name)

If true, the context lists that extension, such as "GL_ARB_sampler_objects".

boolean hasDepthClamp()

If true, the context has depth clamping (OpenGL 3.2 or GL_ARB_depth_clamp), which the state guard turns off for JOID.

boolean hasVertexArrays()

If true, the context has vertex array objects (OpenGL 3.0 or GL_ARB_vertex_array_object).

boolean hasPixelBuffers()

If true, the context has pixel buffer objects (OpenGL 2.1 or an extension).

boolean hasSamplerObjects()

If true, the context has sampler objects (OpenGL 3.3 or GL_ARB_sampler_objects): the bridge unbinds the sampler of each unit it uses.

boolean hasFrameBufferSrgb()

If true, the context has sRGB framebuffers (OpenGL 3.0 or an extension), which the state guard turns off for JOID.

boolean hasFrameBufferBlit()

If true, the context can blit framebuffers: core framebuffers or GL_EXT_framebuffer_blit.

boolean hasPrimitiveRestart()

If true, the context has primitive restart (OpenGL 3.1), which the state guard turns off for JOID.

boolean hasRasterizerDiscard()

If true, the context has rasterizer discard (OpenGL 3.0), which the state guard turns off for JOID.

String getName()

Returns a readable name of the context, such as OpenGL 3.3 with GLSL 3.30 (renderer), which the messages of JOID quote.

GlslDialect getDialect()

Returns the highest desktop GLSL dialect of the context, up to GLSL 3.30; at least GLSL 1.20.

GlFrameBufferFamily getFrameBufferFamily()

Returns CORE for OpenGL 3.0 or GL_ARB_framebuffer_object, EXT for GL_EXT_framebuffer_object, UNSUPPORTED otherwise.

int getVersion()

Returns the OpenGL version times 100, such as 330 for 3.3.

int getGlslVersion()

Returns the GLSL version times 100, such as 330 for 3.30.

GlProfile getProfile()

Returns the profile of the context.

String getRenderer()

Returns the renderer string of the driver.

Set<String> getExtensionSet()

Returns the extensions of the context, read-only.

int getMaxTextureSize()

Returns the largest width and height of a texture, in pixels.

this require() fluent

Throws:

  • IllegalStateException: JOID needs OpenGL 2.1 with GLSL 1.20, this context offers …: update the graphics driver or create a newer OpenGL context
  • IllegalStateException: JOID needs framebuffer objects (OpenGL 3.0, GL_ARB_framebuffer_object or GL_EXT_framebuffer_object), this context offers …: update the graphics driver or create a newer OpenGL context

Returns the capabilities when JOID can draw with them. Throws an IllegalStateException that names the context below OpenGL 2.1 with GLSL 1.20, or without any framebuffer object.


fluent returns the instance, typed for chaining · factory creates an instance · signal also accepts a value that follows signals, as a signal, an expression or a lambda (When does JOID compute this value again?) · hook called by JOID, override it · abstract you implement it · default interface method with a body · static called on the class · protected visible to subclasses

Report a problem with this page