public interface BatchRenderBackend
Modifier and Type | Interface and Description |
---|---|
static interface |
BatchRenderBackend.Image
Helper interface to allow the provideImageDimensions() method to return the image dimension and if necessary
additional data not visible to Nifty.
|
Modifier and Type | Method and Description |
---|---|
void |
addImageToTexture(BatchRenderBackend.Image image,
int x,
int y)
Adds the given image to the main texture atlas at the given position.
|
void |
addQuad(float x,
float y,
float width,
float height,
Color color1,
Color color2,
Color color3,
Color color4,
float textureX,
float textureY,
float textureWidth,
float textureHeight)
Add a quad with the given coordinates to the current batch.
|
void |
beginBatch(BlendMode blendMode)
Begin a new batch with the given BlendMode.
|
void |
beginFrame()
Called every beginning of a frame.
|
void |
clear()
clear screen.
|
void |
clearAtlasTexture(int width,
int height)
Clear the atlas texture.
|
void |
createAtlasTexture(int width,
int height)
Create a texture that will later be used as the texture atlas.
|
MouseCursor |
createMouseCursor(String filename,
int hotspotX,
int hotspotY)
Create a new mouse cursor.
|
void |
disableMouseCursor()
Disable the current mouse cursor.
|
void |
enableMouseCursor(MouseCursor mouseCursor)
Enable the given mouse cursor.
|
void |
endFrame()
Called every end of a frame.
|
int |
getHeight()
Get height of the display mode.
|
int |
getWidth()
Get width of the display mode.
|
BatchRenderBackend.Image |
loadImage(String filename)
Load the given image and provide width and height of the image using the Image interface defined at the bottom.
|
void |
removeFromTexture(BatchRenderBackend.Image image,
int x,
int y,
int w,
int h)
Remove the image from the texture atlas.
|
int |
render()
Render all batches and return the number of batches rendered for statistics.
|
void |
setResourceLoader(NiftyResourceLoader niftyResourceLoader)
Gives this RenderDevice access to the NiftyResourceLoader so that the same paths can be used for resolving
resources as Nifty would do.
|
void setResourceLoader(NiftyResourceLoader niftyResourceLoader)
niftyResourceLoader
- NiftyResourceLoaderint getWidth()
int getHeight()
void beginFrame()
void endFrame()
void clear()
MouseCursor createMouseCursor(String filename, int hotspotX, int hotspotY) throws IOException
filename
- image file for the cursorhotspotX
- hotspot x with 0 being left of the screenhotspotY
- hotspot y with 0 being top of the screenIOException
void enableMouseCursor(MouseCursor mouseCursor)
mouseCursor
- the mouse cursor to enablevoid disableMouseCursor()
void createAtlasTexture(int width, int height)
width
- width of the texture atlasheight
- height of the texture atlasvoid clearAtlasTexture(int width, int height)
BatchRenderBackend.Image loadImage(String filename)
filename
- the filename to loadImageDimension
- instance (could carry additional data like the actual image data if necessary)void addImageToTexture(BatchRenderBackend.Image image, int x, int y)
image
- the Image data loaded by loadImage()x
- the x position where to put the imagey
- the y position where to put the imagevoid beginBatch(BlendMode blendMode)
blendMode
- the blendMode this batch should use. This will be BlendMode.BLEND in most cases and very rare will
it be MULTIPLY.void addQuad(float x, float y, float width, float height, Color color1, Color color2, Color color3, Color color4, float textureX, float textureY, float textureWidth, float textureHeight)
x
- the x position in screen coordinates where to render this quad (0,0 is the left, upper corner)y
- the y position in screen coordinates where to render this quad (0,0 is the left, upper corner)width
- the width of the quad to renderheight
- the height of the quad to rendercolor1
- color of the left upper quad vertexcolor2
- color of the right upper quad vertexcolor3
- color of the right bottom quad vertexcolor4
- color of the left bottom quad vertextextureX
- texture coordinate x of the left side (already normalized in the range 0 to 1)textureY
- texture coordinate y of the upper line (already normalized in the range 0 to 1)textureWidth
- texture width (already normalized in the range 0 to 1)textureHeight
- texture height (already normalized in the range 0 to 1)int render()
void removeFromTexture(BatchRenderBackend.Image image, int x, int y, int w, int h)
image
- image to removex
- x position in texture atlasy
- y position in texture atlasw
- width in texture atlash
- height in texture atlasCopyright © 2013. All Rights Reserved.