Skip to content

Read graphics capabilities

After the renderer has initialized, query its capabilities to decide whether your game can use an optional graphics feature. The result describes the active renderer and device; it can differ when a user selects ANGLE or native OpenGL.

For example, inside simpleInitApp():

import com.jme3.renderer.Caps;
import java.util.EnumSet;
import java.util.logging.Logger;

// Inside simpleInitApp():
EnumSet<Caps> caps = renderer.getCaps();
Logger.getLogger(getClass().getName()).info("Graphics capabilities: " + caps);
if (caps.contains(Caps.FloatTexture)) {
    // Enable a feature that needs floating-point textures.
}

Choose a suitable fallback when an optional feature is unavailable. Some renderer requirements must be met before an application can start, so an in-game check cannot replace testing on the target device. See Rendering and displays for renderer selection.