Search in sources :

Example 1 with LwjglFrameBufferObject

use of org.terasology.engine.rendering.opengl.LwjglFrameBufferObject in project Terasology by MovingBlocks.

the class LwjglCanvasRenderer method getFBO.

@Override
public FrameBufferObject getFBO(ResourceUrn urn, Vector2ic size) {
    LwjglFrameBufferObject frameBufferObject = fboMap.get(urn);
    if (frameBufferObject == null || !Assets.getTexture(urn).isPresent()) {
        // TODO: update fboMap whenever a texture is disposed (or convert FBO instances to assets?)
        if (frameBufferObject != null) {
            frameBufferObject.dispose();
        }
        frameBufferObject = new LwjglFrameBufferObject(modelMatrixStack, projMatrix, displayDevice, urn, size);
        fboMap.put(urn, frameBufferObject);
    }
    return frameBufferObject;
}
Also used : LwjglFrameBufferObject(org.terasology.engine.rendering.opengl.LwjglFrameBufferObject)

Aggregations

LwjglFrameBufferObject (org.terasology.engine.rendering.opengl.LwjglFrameBufferObject)1