Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.

public final class GpuCapabilities

  1. Object
  2. GpuCapabilities
Immutable description of the capabilities and limits of a GraphicsDevice. Backends create an instance describing the underlying GPU so portable code can adapt to the platform. Applications retrieve it via GraphicsDevice.getCapabilities().

Constructors

public GpuCapabilities(int maxTextureSize, int maxVertexAttributes, boolean shaderLevel3, boolean depthTextureSupported, boolean intIndicesSupported, String rendererName)Constructs a capabilities descriptor.
public GpuCapabilities(int maxTextureSize, int maxVertexAttributes, boolean shaderLevel3, boolean depthTextureSupported, boolean intIndicesSupported, String rendererName, boolean shadowsSupported, boolean postProcessSupported)Creates a capability descriptor that also says whether the device renders shadow maps and full screen post processing.

Methods

public boolean isShadowsSupported()Returns true if the device renders shadow maps for a light with shadows on.
public boolean isPostProcessSupported()Returns true if the device applies a PostProcess to the frame.
public int getMaxTextureSize()Returns the maximum supported texture edge length in pixels.
public int getMaxVertexAttributes()Returns the maximum number of vertex attributes supported per draw.
public boolean isShaderLevel3()Returns true if GLSL ES 3 / WebGL2 class shading features are available.
public boolean isDepthTextureSupported()Returns true if depth textures may be sampled (useful for shadow mapping).
public boolean isIntIndicesSupported()Returns true if 32 bit (int) element indices are supported.
public String getRendererName()Returns a human readable description of the backend and GPU.

Inherited methods

Constructor details

GpuCapabilities

public GpuCapabilities(int maxTextureSize, int maxVertexAttributes, boolean shaderLevel3, boolean depthTextureSupported, boolean intIndicesSupported, String rendererName)
Constructs a capabilities descriptor. Intended to be called by platform backends only.

Parameters

maxTextureSize int
the maximum supported texture edge length in pixels
maxVertexAttributes int
the maximum number of vertex attributes
shaderLevel3 boolean
true if GLSL ES 3 / WebGL2 class shaders are available
depthTextureSupported boolean
true if sampling depth textures is supported
intIndicesSupported boolean
true if 32 bit element indices are supported
rendererName String
a human readable backend/renderer description

GpuCapabilities

public GpuCapabilities(int maxTextureSize, int maxVertexAttributes, boolean shaderLevel3, boolean depthTextureSupported, boolean intIndicesSupported, String rendererName, boolean shadowsSupported, boolean postProcessSupported)
Creates a capability descriptor that also says whether the device renders shadow maps and full screen post processing.

Parameters

maxTextureSize int
the maximum texture dimension in pixels
maxVertexAttributes int
the maximum number of vertex attributes
shaderLevel3 boolean
true if GLSL ES 3 / Metal 2 class features exist
depthTextureSupported boolean
true if depth textures may be sampled
intIndicesSupported boolean
true if 32 bit element indices are supported
rendererName String
a human readable backend/renderer description
shadowsSupported boolean
true if GraphicsDevice.beginShadowPass works
postProcessSupported boolean
true if GraphicsDevice.beginPostProcess works

Method details

isShadowsSupported

public boolean isShadowsSupported()
Returns true if the device renders shadow maps for a light with shadows on.

isPostProcessSupported

public boolean isPostProcessSupported()
Returns true if the device applies a PostProcess to the frame.

getMaxTextureSize

public int getMaxTextureSize()
Returns the maximum supported texture edge length in pixels.

getMaxVertexAttributes

public int getMaxVertexAttributes()
Returns the maximum number of vertex attributes supported per draw.

isShaderLevel3

public boolean isShaderLevel3()
Returns true if GLSL ES 3 / WebGL2 class shading features are available.

isDepthTextureSupported

public boolean isDepthTextureSupported()
Returns true if depth textures may be sampled (useful for shadow mapping).

isIntIndicesSupported

public boolean isIntIndicesSupported()
Returns true if 32 bit (int) element indices are supported. When false an IndexBuffer is limited to 16 bit indices.

getRendererName

public String getRendererName()
Returns a human readable description of the backend and GPU.