net.ctdp.rfdynhud.render
Class TextureDirtyRectsManager
java.lang.Object
net.ctdp.rfdynhud.render.TextureDirtyRectsManager
public class TextureDirtyRectsManager
- extends java.lang.Object
This class provides a public interface to retrieve the current dirty rectangles.
- Author:
- Marvin Froehlich (CTDP)
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TextureDirtyRectsManager
public TextureDirtyRectsManager()
createByteBuffer
public static java.nio.ByteBuffer createByteBuffer(int maxNumDirtyRects)
getDirtyRects
public static short getDirtyRects(TextureImage2D texture,
java.nio.ByteBuffer buffer,
boolean resetBufferToStart)
- Gets all the current dirty-rects from the given texture.
The number of dirty rectangles is written as a short to the first two bytes of the buffer.
Then each rectangle is written as four shorts in the order left,top,width,height.
After this method finished all dirty rectangles information will be removed from the texture.
- Parameters:
texture
- the texture to handle dirty rectangles ofbuffer
- the buffer to write the information toresetBufferToStart
- if true, the buffer is set to position zero before anything is written to it
- Returns:
- the number of dirty rectangles. If the buffer iss too small the number is returned as a negative number.
drawDirtyRects
public static void drawDirtyRects(TextureImage2D texture)
- This is just for debugging!
- Parameters:
texture
- the take dirty rects from and to draw on