You mean you want to render not to the screen, but to a texture.
You can't render to a texture, but you can render to a FBO.
First you create a FBO.
Then bind that, check out GL_DRAW_FRAMEBUFFER
Render
Get the data:
ByteBuffer getFramePixels(int width, int height){
glReadBuffer(GL_COLOR_ATTACHMENT0);
int bpp = 4;
ByteBuffer buffer = BufferUtils.createByteBuffer(width * height * bpp);
glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
return buffer;
}
Turn the data into a texture.