|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object codeanticode.glgraphics.GLTexturePingPong
public class GLTexturePingPong
This class encapsulates two GLTextures, that are labeled as read and write. The role of each texture is swaped upon calling the swap function. This class is intended to simplify the code in GP-GPU applications, where there is the need to apply iterative operations on textures holding float data that represents coordinates or velocities of particles, etc. This technique of alternatively swaping the textures to allow for read/write operations is called "Ping-Pong".
Constructor Summary | |
---|---|
GLTexturePingPong(GLTexture tex0,
GLTexture tex1)
The constructor of the class. |
Method Summary | |
---|---|
GLTexture |
getNewTex()
Returns the current write texture. |
GLTexture |
getOldTex()
Returns the current read texture. |
GLTexture |
getReadTex()
Returns the current read texture. |
GLTexture |
getWriteTex()
Returns the current write texture. |
void |
init()
Inits the read and write indices. |
void |
setNewTex(int idx)
Sets the value for the write texture. |
void |
setOldTex(int idx)
Sets the value for the read texture. |
void |
setReadTex(int idx)
Sets the value for the read texture. |
void |
setWriteTex(int idx)
Sets the value for the write texture. |
void |
swap()
Swaps the two textures, read becomes write and viceversa. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GLTexturePingPong(GLTexture tex0, GLTexture tex1)
tex0
- GLTexturetex1
- GLTextureMethod Detail |
---|
public GLTexture getReadTex()
public void setReadTex(int idx)
idx
- intpublic GLTexture getWriteTex()
public void setWriteTex(int idx)
idx
- intpublic GLTexture getOldTex()
public void setOldTex(int idx)
idx
- intpublic GLTexture getNewTex()
public void setNewTex(int idx)
idx
- intpublic void init()
public void swap()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |