public class GLReadBufferUtil extends Object
May be used directly to write the TextureData to file (screenshot).
Constructor and Description |
---|
GLReadBufferUtil(boolean alpha,
boolean write2Texture) |
Modifier and Type | Method and Description |
---|---|
void |
dispose(GL gl) |
ByteBuffer |
getPixelBuffer() |
Texture |
getTexture() |
TextureData |
getTextureData() |
boolean |
isValid() |
boolean |
readPixels(GL gl,
GLDrawable drawable,
boolean flip)
Read the drawable's pixels to TextureData and Texture, if requested at construction
|
void |
rewindPixelBuffer()
rewind the raw pixel ByteBuffer
|
void |
write(File dest)
Write the TextureData filled by
#readPixels(GLAutoDrawable, boolean) to file |
public GLReadBufferUtil(boolean alpha, boolean write2Texture)
alpha
- true for RGBA readPixels, otherwise RGB readPixels. Disclaimer: Alpha maybe forced on ES platforms!write2Texture
- true if readPixel's TextureData shall be written to a 2d Texturepublic boolean isValid()
public ByteBuffer getPixelBuffer()
#readPixels(GLAutoDrawable, boolean)
public void rewindPixelBuffer()
public TextureData getTextureData()
#readPixels(GLAutoDrawable, boolean)
public Texture getTexture()
#readPixels(GLAutoDrawable, boolean)
,
if this instance writes to a 2d Texture, otherwise null.GLReadBufferUtil(boolean, boolean)
public void write(File dest)
#readPixels(GLAutoDrawable, boolean)
to filepublic boolean readPixels(GL gl, GLDrawable drawable, boolean flip)
gl
- the current GL objectdrawable
- the drawable to read fromflip
- weather to flip the data vertically or notGLReadBufferUtil(boolean, boolean)
public void dispose(GL gl)
Copyright 2010 JogAmp Community.