Search in sources :

Example 1 with RenderTexture

use of org.lwjgl.opengl.RenderTexture in project lwjgl by LWJGL.

the class UniqueRendererRTT method init.

// Initialize texture renderer
protected Pbuffer init(final int width, final int height, final int texID) {
    Pbuffer pbuffer = null;
    try {
        final RenderTexture rt = new RenderTexture(true, false, false, false, RenderTexture.RENDER_TEXTURE_2D, 0);
        pbuffer = new Pbuffer(width, height, new PixelFormat(16, 0, 0, 0, 0), rt, null);
        // Initialise state of the pbuffer context.
        pbuffer.makeCurrent();
        PbufferTest.initGLState(width, height, 0.5f);
        glBindTexture(GL_TEXTURE_2D, texID);
        Display.makeCurrent();
    } catch (LWJGLException e) {
        e.printStackTrace();
        System.exit(-1);
    }
    return pbuffer;
}
Also used : RenderTexture(org.lwjgl.opengl.RenderTexture) PixelFormat(org.lwjgl.opengl.PixelFormat) Pbuffer(org.lwjgl.opengl.Pbuffer) LWJGLException(org.lwjgl.LWJGLException)

Aggregations

LWJGLException (org.lwjgl.LWJGLException)1 Pbuffer (org.lwjgl.opengl.Pbuffer)1 PixelFormat (org.lwjgl.opengl.PixelFormat)1 RenderTexture (org.lwjgl.opengl.RenderTexture)1