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.
Description
Section titled “Description”GlRenderBridge picks one path per feature from it: GLSL dialect, framebuffer family, vertex arrays, mipmap builder.
Learn more
Section titled “Learn more”Creation
Section titled “Creation”| Returns | Signature | Summary |
|---|---|---|
GlCapabilities | read(IGlBinding binding) factory | Reads the capabilities of the current context. |
Methods
Section titled “Methods”Queries
Section titled “Queries”| Returns | Signature | Summary |
|---|---|---|
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. |
Actions
Section titled “Actions”| Returns | Signature | Summary |
|---|---|---|
this | require() fluent | Returns the capabilities when JOID can draw with them. |
Creation details
Section titled “Creation details”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.
Method details
Section titled “Method details”hasExtension
Section titled “hasExtension”boolean hasExtension(String name)
If true, the context lists that extension, such as "GL_ARB_sampler_objects".
hasDepthClamp
Section titled “hasDepthClamp”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.
hasVertexArrays
Section titled “hasVertexArrays”boolean hasVertexArrays()
If true, the context has vertex array objects (OpenGL 3.0 or GL_ARB_vertex_array_object).
hasPixelBuffers
Section titled “hasPixelBuffers”boolean hasPixelBuffers()
If true, the context has pixel buffer objects (OpenGL 2.1 or an extension).
hasSamplerObjects
Section titled “hasSamplerObjects”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.
hasFrameBufferSrgb
Section titled “hasFrameBufferSrgb”boolean hasFrameBufferSrgb()
If true, the context has sRGB framebuffers (OpenGL 3.0 or an extension), which the state guard turns off for JOID.
hasFrameBufferBlit
Section titled “hasFrameBufferBlit”boolean hasFrameBufferBlit()
If true, the context can blit framebuffers: core framebuffers or GL_EXT_framebuffer_blit.
hasPrimitiveRestart
Section titled “hasPrimitiveRestart”boolean hasPrimitiveRestart()
If true, the context has primitive restart (OpenGL 3.1), which the state guard turns off for JOID.
hasRasterizerDiscard
Section titled “hasRasterizerDiscard”boolean hasRasterizerDiscard()
If true, the context has rasterizer discard (OpenGL 3.0), which the state guard turns off for JOID.
getName
Section titled “getName”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.
getDialect
Section titled “getDialect”GlslDialect getDialect()
Returns the highest desktop GLSL dialect of the context, up to GLSL 3.30; at least GLSL 1.20.
getFrameBufferFamily
Section titled “getFrameBufferFamily”GlFrameBufferFamily getFrameBufferFamily()
Returns CORE for OpenGL 3.0 or GL_ARB_framebuffer_object, EXT for GL_EXT_framebuffer_object, UNSUPPORTED otherwise.
getVersion
Section titled “getVersion”int getVersion()
Returns the OpenGL version times 100, such as 330 for 3.3.
getGlslVersion
Section titled “getGlslVersion”int getGlslVersion()
Returns the GLSL version times 100, such as 330 for 3.30.
getProfile
Section titled “getProfile”GlProfile getProfile()
Returns the profile of the context.
getRenderer
Section titled “getRenderer”String getRenderer()
Returns the renderer string of the driver.
getExtensionSet
Section titled “getExtensionSet”Set<String> getExtensionSet()
Returns the extensions of the context, read-only.
getMaxTextureSize
Section titled “getMaxTextureSize”int getMaxTextureSize()
Returns the largest width and height of a texture, in pixels.
require
Section titled “require”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 contextIllegalStateException: 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
