public class NiftyJmeDisplay extends java.lang.Object implements SceneProcessor
Modifier and Type | Class and Description |
---|---|
protected class |
NiftyJmeDisplay.ResourceLocationJme |
Modifier and Type | Field and Description |
---|---|
protected AssetManager |
assetManager |
protected JmeBatchRenderBackend |
batchRendererBackend |
protected int |
h |
protected boolean |
inited |
protected InputManager |
inputManager |
protected InputSystemJme |
inputSys |
protected de.lessvoid.nifty.Nifty |
nifty |
protected RenderDeviceJme |
renderDev |
protected Renderer |
renderer |
protected RenderManager |
renderManager |
protected NiftyJmeDisplay.ResourceLocationJme |
resourceLocation |
protected SoundDeviceJme |
soundDev |
protected ViewPort |
vp |
protected int |
w |
Constructor and Description |
---|
NiftyJmeDisplay() |
NiftyJmeDisplay(AssetManager assetManager,
InputManager inputManager,
AudioRenderer audioRenderer,
ViewPort vp)
Create a standard NiftyJmeDisplay.
|
NiftyJmeDisplay(AssetManager assetManager,
InputManager inputManager,
AudioRenderer audioRenderer,
ViewPort viewport,
int atlasWidth,
int atlasHeight)
Deprecated.
use the static factory methods
newNiftyJmeDisplay(com.jme3.asset.AssetManager, com.jme3.input.InputManager, com.jme3.audio.AudioRenderer, com.jme3.renderer.ViewPort)
or newNiftyJmeDisplay(com.jme3.asset.AssetManager, com.jme3.input.InputManager, com.jme3.audio.AudioRenderer, com.jme3.renderer.ViewPort, de.lessvoid.nifty.render.batch.BatchRenderConfiguration)
instead of this constructor. |
Modifier and Type | Method and Description |
---|---|
void |
cleanup()
Called when the SP is removed from the RM.
|
de.lessvoid.nifty.Nifty |
getNifty() |
void |
initialize(RenderManager rm,
ViewPort vp)
Called in the render thread to initialize the scene processor.
|
boolean |
isInitialized() |
static NiftyJmeDisplay |
newNiftyJmeDisplay(AssetManager assetManager,
InputManager inputManager,
AudioRenderer audioRenderer,
ViewPort viewport)
Create a new NiftyJmeDisplay for use with the Batched Nifty Renderer.
|
static NiftyJmeDisplay |
newNiftyJmeDisplay(AssetManager assetManager,
InputManager inputManager,
AudioRenderer audioRenderer,
ViewPort viewport,
de.lessvoid.nifty.render.batch.BatchRenderConfiguration batchRenderConfiguration)
Create a new NiftyJmeDisplay for use with the Batched Nifty Renderer.
|
void |
postFrame(FrameBuffer out)
Called after a frame has been rendered and the queue flushed.
|
void |
postQueue(RenderQueue rq)
Called after the scene graph has been queued, but before it is flushed.
|
void |
preFrame(float tpf)
Called before a frame
|
void |
reshape(ViewPort vp,
int w,
int h)
Called when the resolution of the viewport has been changed.
|
void |
setProfiler(AppProfiler profiler)
Sets a profiler Instance for this processor.
|
void |
simulateKeyEvent(KeyInputEvent event) |
protected boolean inited
protected de.lessvoid.nifty.Nifty nifty
protected AssetManager assetManager
protected RenderManager renderManager
protected InputManager inputManager
protected RenderDeviceJme renderDev
protected JmeBatchRenderBackend batchRendererBackend
protected InputSystemJme inputSys
protected SoundDeviceJme soundDev
protected Renderer renderer
protected ViewPort vp
protected NiftyJmeDisplay.ResourceLocationJme resourceLocation
protected int w
protected int h
public NiftyJmeDisplay()
public NiftyJmeDisplay(AssetManager assetManager, InputManager inputManager, AudioRenderer audioRenderer, ViewPort viewport, int atlasWidth, int atlasHeight)
newNiftyJmeDisplay(com.jme3.asset.AssetManager, com.jme3.input.InputManager, com.jme3.audio.AudioRenderer, com.jme3.renderer.ViewPort)
or newNiftyJmeDisplay(com.jme3.asset.AssetManager, com.jme3.input.InputManager, com.jme3.audio.AudioRenderer, com.jme3.renderer.ViewPort, de.lessvoid.nifty.render.batch.BatchRenderConfiguration)
instead of this constructor.assetManager
- jME AssetManagerinputManager
- jME InputManageraudioRenderer
- jME AudioRendererviewport
- Viewport to useatlasWidth
- the width of the texture atlas Nifty uses to speed up rendering (2048 is a good value)atlasHeight
- the height of the texture atlas Nifty uses to speed up rendering (2048 is a good value)public NiftyJmeDisplay(AssetManager assetManager, InputManager inputManager, AudioRenderer audioRenderer, ViewPort vp)
assetManager
- jME AssetManagerinputManager
- jME InputManageraudioRenderer
- jME AudioRenderervp
- Viewport to usepublic static NiftyJmeDisplay newNiftyJmeDisplay(AssetManager assetManager, InputManager inputManager, AudioRenderer audioRenderer, ViewPort viewport)
newNiftyJmeDisplay(com.jme3.asset.AssetManager, com.jme3.input.InputManager, com.jme3.audio.AudioRenderer, com.jme3.renderer.ViewPort, de.lessvoid.nifty.render.batch.BatchRenderConfiguration)
when you want to change the default BatchRenderConfiguration and provide
your own.assetManager
- jME AssetManagerinputManager
- jME InputManageraudioRenderer
- jME AudioRendererviewport
- Viewport to usepublic static NiftyJmeDisplay newNiftyJmeDisplay(AssetManager assetManager, InputManager inputManager, AudioRenderer audioRenderer, ViewPort viewport, de.lessvoid.nifty.render.batch.BatchRenderConfiguration batchRenderConfiguration)
assetManager
- jME AssetManagerinputManager
- jME InputManageraudioRenderer
- jME AudioRendererviewport
- Viewport to usebatchRenderConfiguration
- the Nifty BatchRenderConfiguration that
you can use to further configure batch rendering. If unsure you
can simply use new BatchRenderConfiguration() in here for the
default configuration which should give you good default values.public void initialize(RenderManager rm, ViewPort vp)
SceneProcessor
initialize
in interface SceneProcessor
rm
- The render manager to which the SP was added tovp
- The viewport to which the SP is assignedpublic de.lessvoid.nifty.Nifty getNifty()
public void simulateKeyEvent(KeyInputEvent event)
public void reshape(ViewPort vp, int w, int h)
SceneProcessor
reshape
in interface SceneProcessor
vp
- the affected ViewPortw
- the new width (in pixels)h
- the new height (in pixels)public boolean isInitialized()
isInitialized
in interface SceneProcessor
public void preFrame(float tpf)
SceneProcessor
preFrame
in interface SceneProcessor
tpf
- Time per framepublic void postQueue(RenderQueue rq)
SceneProcessor
postQueue
in interface SceneProcessor
rq
- The render queuepublic void postFrame(FrameBuffer out)
SceneProcessor
postFrame
in interface SceneProcessor
out
- The FB to which the scene was rendered.public void cleanup()
SceneProcessor
cleanup
in interface SceneProcessor
public void setProfiler(AppProfiler profiler)
SceneProcessor
setProfiler
in interface SceneProcessor
profiler
- the profiler instance.