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;
}
Aggregations