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

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    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
     
    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
     
    boolean
    existsNonAtlasTexture(int textureId)
     
    void
    fillRemovedImagesInAtlas(boolean shouldFill)
    Whether or not to overwrite previously used atlas space with blank data.
    int
     
    int
     
    de.lessvoid.nifty.render.batch.spi.BatchRenderBackend.Image
    loadImage(String filename)
     
    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
     
    void
     
    void
    setResourceLoader(de.lessvoid.nifty.tools.resourceloader.NiftyResourceLoader resourceLoader)
     
    void
    useHighQualityTextures(boolean shouldUseHighQualityTextures)
    Whether or not to render textures with high quality settings.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • JmeBatchRenderBackend

      public JmeBatchRenderBackend(NiftyJmeDisplay display)
  • Method Details

    • setRenderManager

      public void setRenderManager(RenderManager rm)
    • setResourceLoader

      public void setResourceLoader(de.lessvoid.nifty.tools.resourceloader.NiftyResourceLoader resourceLoader)
      Specified by:
      setResourceLoader in interface de.lessvoid.nifty.render.batch.spi.BatchRenderBackend
    • getWidth

      public int getWidth()
      Specified by:
      getWidth in interface de.lessvoid.nifty.render.batch.spi.BatchRenderBackend
    • getHeight

      public int getHeight()
      Specified by:
      getHeight in interface de.lessvoid.nifty.render.batch.spi.BatchRenderBackend
    • beginFrame

      public void beginFrame()
      Specified by:
      beginFrame in interface de.lessvoid.nifty.render.batch.spi.BatchRenderBackend
    • endFrame

      public void endFrame()
      Specified by:
      endFrame in interface de.lessvoid.nifty.render.batch.spi.BatchRenderBackend
    • clear

      public void clear()
      Specified by:
      clear in interface de.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 interface de.lessvoid.nifty.render.batch.spi.BatchRenderBackend
      Throws:
      IOException
    • enableMouseCursor

      public void enableMouseCursor(de.lessvoid.nifty.spi.render.MouseCursor mouseCursor)
      Specified by:
      enableMouseCursor in interface de.lessvoid.nifty.render.batch.spi.BatchRenderBackend
    • disableMouseCursor

      public void disableMouseCursor()
      Specified by:
      disableMouseCursor in interface de.lessvoid.nifty.render.batch.spi.BatchRenderBackend
    • createTextureAtlas

      public int createTextureAtlas(int width, int height)
      Specified by:
      createTextureAtlas in interface de.lessvoid.nifty.render.batch.spi.BatchRenderBackend
    • clearTextureAtlas

      public void clearTextureAtlas(int atlasId)
      Specified by:
      clearTextureAtlas in interface de.lessvoid.nifty.render.batch.spi.BatchRenderBackend
    • loadImage

      public de.lessvoid.nifty.render.batch.spi.BatchRenderBackend.Image loadImage(String filename)
      Specified by:
      loadImage in interface de.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 interface de.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 interface de.lessvoid.nifty.render.batch.spi.BatchRenderBackend
    • createNonAtlasTexture

      public int createNonAtlasTexture(de.lessvoid.nifty.render.batch.spi.BatchRenderBackend.Image image)
      Specified by:
      createNonAtlasTexture in interface de.lessvoid.nifty.render.batch.spi.BatchRenderBackend
    • deleteNonAtlasTexture

      public void deleteNonAtlasTexture(int textureId)
      Specified by:
      deleteNonAtlasTexture in interface de.lessvoid.nifty.render.batch.spi.BatchRenderBackend
    • existsNonAtlasTexture

      public boolean existsNonAtlasTexture(int textureId)
      Specified by:
      existsNonAtlasTexture in interface de.lessvoid.nifty.render.batch.spi.BatchRenderBackend
    • beginBatch

      public void beginBatch(de.lessvoid.nifty.render.BlendMode blendMode, int textureId)
      Specified by:
      beginBatch in interface de.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 interface de.lessvoid.nifty.render.batch.spi.BatchRenderBackend
    • render

      public int render()
      Specified by:
      render in interface de.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 interface de.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 the BatchRenderBackend implementation
      Specified by:
      useHighQualityTextures in interface de.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 interface de.lessvoid.nifty.render.batch.spi.BatchRenderBackend
      Parameters:
      shouldFill - true→overwrite with blank data, false→don't overwrite