Package com.jme3.niftygui
Class JmeBatchRenderBackend
java.lang.Object
com.jme3.niftygui.JmeBatchRenderBackend
- All Implemented Interfaces:
de.lessvoid.nifty.render.batch.spi.BatchRenderBackend
public class JmeBatchRenderBackend
extends Object
implements de.lessvoid.nifty.render.batch.spi.BatchRenderBackend
Nifty GUI BatchRenderBackend Implementation for jMonkeyEngine.
-
Nested Class Summary
Nested classes/interfaces inherited from interface de.lessvoid.nifty.render.batch.spi.BatchRenderBackend
de.lessvoid.nifty.render.batch.spi.BatchRenderBackend.ByteBufferedImage, de.lessvoid.nifty.render.batch.spi.BatchRenderBackend.Image
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addImageToAtlas
(de.lessvoid.nifty.render.batch.spi.BatchRenderBackend.Image image, int x, int y, int atlasTextureId) void
addQuad
(float x, float y, float width, float height, de.lessvoid.nifty.tools.Color color1, de.lessvoid.nifty.tools.Color color2, de.lessvoid.nifty.tools.Color color3, de.lessvoid.nifty.tools.Color color4, float textureX, float textureY, float textureWidth, float textureHeight, int textureId) void
beginBatch
(de.lessvoid.nifty.render.BlendMode blendMode, int textureId) void
void
clear()
void
clearTextureAtlas
(int atlasId) de.lessvoid.nifty.spi.render.MouseCursor
createMouseCursor
(String filename, int hotspotX, int hotspotY) int
createNonAtlasTexture
(de.lessvoid.nifty.render.batch.spi.BatchRenderBackend.Image image) int
createTextureAtlas
(int width, int height) void
deleteNonAtlasTexture
(int textureId) void
void
enableMouseCursor
(de.lessvoid.nifty.spi.render.MouseCursor mouseCursor) void
endFrame()
boolean
existsNonAtlasTexture
(int textureId) void
fillRemovedImagesInAtlas
(boolean shouldFill) Whether or not to overwrite previously used atlas space with blank data.int
int
getWidth()
de.lessvoid.nifty.render.batch.spi.BatchRenderBackend.Image
de.lessvoid.nifty.render.batch.spi.BatchRenderBackend.Image
loadImage
(ByteBuffer imageData, int imageWidth, int imageHeight) void
removeImageFromAtlas
(de.lessvoid.nifty.render.batch.spi.BatchRenderBackend.Image image, int x, int y, int w, int h, int atlasTextureId) int
render()
void
void
setResourceLoader
(de.lessvoid.nifty.tools.resourceloader.NiftyResourceLoader resourceLoader) void
useHighQualityTextures
(boolean shouldUseHighQualityTextures) Whether or not to render textures with high quality settings.
-
Constructor Details
-
JmeBatchRenderBackend
-
-
Method Details
-
setRenderManager
-
setResourceLoader
public void setResourceLoader(de.lessvoid.nifty.tools.resourceloader.NiftyResourceLoader resourceLoader) - Specified by:
setResourceLoader
in interfacede.lessvoid.nifty.render.batch.spi.BatchRenderBackend
-
getWidth
public int getWidth()- Specified by:
getWidth
in interfacede.lessvoid.nifty.render.batch.spi.BatchRenderBackend
-
getHeight
public int getHeight()- Specified by:
getHeight
in interfacede.lessvoid.nifty.render.batch.spi.BatchRenderBackend
-
beginFrame
public void beginFrame()- Specified by:
beginFrame
in interfacede.lessvoid.nifty.render.batch.spi.BatchRenderBackend
-
endFrame
public void endFrame()- Specified by:
endFrame
in interfacede.lessvoid.nifty.render.batch.spi.BatchRenderBackend
-
clear
public void clear()- Specified by:
clear
in interfacede.lessvoid.nifty.render.batch.spi.BatchRenderBackend
-
createMouseCursor
public de.lessvoid.nifty.spi.render.MouseCursor createMouseCursor(String filename, int hotspotX, int hotspotY) throws IOException - Specified by:
createMouseCursor
in interfacede.lessvoid.nifty.render.batch.spi.BatchRenderBackend
- Throws:
IOException
-
enableMouseCursor
public void enableMouseCursor(de.lessvoid.nifty.spi.render.MouseCursor mouseCursor) - Specified by:
enableMouseCursor
in interfacede.lessvoid.nifty.render.batch.spi.BatchRenderBackend
-
disableMouseCursor
public void disableMouseCursor()- Specified by:
disableMouseCursor
in interfacede.lessvoid.nifty.render.batch.spi.BatchRenderBackend
-
createTextureAtlas
public int createTextureAtlas(int width, int height) - Specified by:
createTextureAtlas
in interfacede.lessvoid.nifty.render.batch.spi.BatchRenderBackend
-
clearTextureAtlas
public void clearTextureAtlas(int atlasId) - Specified by:
clearTextureAtlas
in interfacede.lessvoid.nifty.render.batch.spi.BatchRenderBackend
-
loadImage
- Specified by:
loadImage
in interfacede.lessvoid.nifty.render.batch.spi.BatchRenderBackend
-
loadImage
public de.lessvoid.nifty.render.batch.spi.BatchRenderBackend.Image loadImage(ByteBuffer imageData, int imageWidth, int imageHeight) - Specified by:
loadImage
in interfacede.lessvoid.nifty.render.batch.spi.BatchRenderBackend
-
addImageToAtlas
public void addImageToAtlas(de.lessvoid.nifty.render.batch.spi.BatchRenderBackend.Image image, int x, int y, int atlasTextureId) - Specified by:
addImageToAtlas
in interfacede.lessvoid.nifty.render.batch.spi.BatchRenderBackend
-
createNonAtlasTexture
public int createNonAtlasTexture(de.lessvoid.nifty.render.batch.spi.BatchRenderBackend.Image image) - Specified by:
createNonAtlasTexture
in interfacede.lessvoid.nifty.render.batch.spi.BatchRenderBackend
-
deleteNonAtlasTexture
public void deleteNonAtlasTexture(int textureId) - Specified by:
deleteNonAtlasTexture
in interfacede.lessvoid.nifty.render.batch.spi.BatchRenderBackend
-
existsNonAtlasTexture
public boolean existsNonAtlasTexture(int textureId) - Specified by:
existsNonAtlasTexture
in interfacede.lessvoid.nifty.render.batch.spi.BatchRenderBackend
-
beginBatch
public void beginBatch(de.lessvoid.nifty.render.BlendMode blendMode, int textureId) - Specified by:
beginBatch
in interfacede.lessvoid.nifty.render.batch.spi.BatchRenderBackend
-
addQuad
public void addQuad(float x, float y, float width, float height, de.lessvoid.nifty.tools.Color color1, de.lessvoid.nifty.tools.Color color2, de.lessvoid.nifty.tools.Color color3, de.lessvoid.nifty.tools.Color color4, float textureX, float textureY, float textureWidth, float textureHeight, int textureId) - Specified by:
addQuad
in interfacede.lessvoid.nifty.render.batch.spi.BatchRenderBackend
-
render
public int render()- Specified by:
render
in interfacede.lessvoid.nifty.render.batch.spi.BatchRenderBackend
-
removeImageFromAtlas
public void removeImageFromAtlas(de.lessvoid.nifty.render.batch.spi.BatchRenderBackend.Image image, int x, int y, int w, int h, int atlasTextureId) - Specified by:
removeImageFromAtlas
in interfacede.lessvoid.nifty.render.batch.spi.BatchRenderBackend
-
useHighQualityTextures
public void useHighQualityTextures(boolean shouldUseHighQualityTextures) Whether or not to render textures with high quality settings. Usually, setting to true will result in slower performance, but nicer looking textures, and vice versa. How high quality textures are rendered versus low quality textures will vary depending on theBatchRenderBackend
implementation- Specified by:
useHighQualityTextures
in interfacede.lessvoid.nifty.render.batch.spi.BatchRenderBackend
- Parameters:
shouldUseHighQualityTextures
- true→higher quality, false→lower quality
-
fillRemovedImagesInAtlas
public void fillRemovedImagesInAtlas(boolean shouldFill) Whether or not to overwrite previously used atlas space with blank data. Setting to true will result in slower performance, but may be useful in debugging when visually inspecting the atlas, since there will not be portions of old images visible in currently unused atlas space.- Specified by:
fillRemovedImagesInAtlas
in interfacede.lessvoid.nifty.render.batch.spi.BatchRenderBackend
- Parameters:
shouldFill
- true→overwrite with blank data, false→don't overwrite
-