private FBO(int texture, boolean ownTexture, int x0, int y0, int width, int height) { this.texture = texture; this.ownTexture = ownTexture; this.x0 = x0; this.y0 = y0; this.width = width; this.height = height; frameBuffer = EXTFramebufferObject.glGenFramebuffersEXT(); if (frameBuffer < 0) { throw new RuntimeException("could not get framebuffer object"); } GLAPI.glBindTexture(texture); EXTFramebufferObject.glBindFramebufferEXT( EXTFramebufferObject.GL_FRAMEBUFFER_EXT, frameBuffer); EXTFramebufferObject.glFramebufferTexture2DEXT( EXTFramebufferObject.GL_FRAMEBUFFER_EXT, EXTFramebufferObject.GL_COLOR_ATTACHMENT0_EXT, GL11.GL_TEXTURE_2D, texture, 0); }