bio photo

Nifty 1.3.3 is mainly a bugfix release and is compatible with older Nifty 1.3.x versions.

The main new feature is the batched renderer for improved rendering speed of more complex GUIs (with many elements) and OpenGL Core Profile support (in native LWJGL/JOGL renderer).

Usage of the batched renderer is easy. Instead of your regular RenderDevice implementation you use the new BatchRenderDevice that Nifty already provides together with the BatchRendererBackend implementation and the size of the texture atlas. The following examples all use a texture atlas of 2048x2048 pixels which worked very well for all Nifty standard examples.

Examples:

LWJGL Example:</strong></p>

BatchRenderDevice renderDevice = new BatchRenderDevice(
new LwjglBatchRenderBackend(), 2048, 2048);</pre></p>

LWJGL Core Profile Example:</strong></p>

BatchRenderDevice renderDevice = new BatchRenderDevice(
new LwjglBatchRenderBackendCoreProfile(), 2048, 2048);</pre></p>

And if you prefer JOGL (which we've updated and added new example code for as well):

JOGL Example:</strong></p>

BatchRenderDevice renderDevice = new BatchRenderDevice(
new JoglBatchRenderBackend(), 2048, 2048);</pre></p>

JOGL Core Profile Example:</strong></p>

BatchRenderDevice renderDevice = new BatchRenderDevice(
new JoglBatchRenderBackendCoreProfile(), 2048, 2048);</pre></p>

Usage in jMonkeyEngine is even easier. You just have to call the constructor of the NiftyJmeDisplay with two additional parameters (the width and height of the texture atlas you'd like to use):

jMonkeyEngine Example:</strong></p>

    niftyDisplay = new NiftyJmeDisplayTime(
assetManager,
inputManager,
audioRenderer,
guiViewPort,
2048, 2048); // add these two to enable the batched renderer</pre></p>

As always it's up to you to initialize LWJGL/JOGL before initializing Nifty but you can find code on how to do that in the nifty-examples project.

If you'd like to learn more about the batched renderer and how it works you can find out more about it in this two part blog post:

Inside Niftys RenderDevice and how to speed it up (Part 1/2)</a>
Inside Niftys RenderDevice and how to speed it up (Part 2/2)</a></p>

And here are the other Nifty links:

Nifty 1.3.3 change log (sf.net)</a>
Nifty 1.3.3 Download Folder at sf.net</a>
Nifty 1.3.3 Maven Projects Page (browse the JavaDoc online!)</a>
Get a nightly jME3 build with Nifty 1.3.3 (starting tommorow or so ;) since it was just been added with
this commit</a> to the jme repo)</p>

For all Maven users: Simply add our sf.net Nifty Maven Repo to your pom.xml:

  

nifty-maven-repo.sourceforge.net</id>
http://nifty-gui.sourceforge.net/nifty-maven-repo</url>
</repository>
</repositories></pre></p>

and upgrade your dependency to 1.3.3:

    
lessvoid</groupId>
nifty</artifactId>
1.3.3</version>
</dependency></pre></p>

Have a lot of fun with Nifty 1.3.3! The best Nifty since Nifty ;-)
void