Package com.jme3.niftygui
Class NiftyJmeDisplay
java.lang.Object
com.jme3.niftygui.NiftyJmeDisplay
- All Implemented Interfaces:
com.jme3.post.SceneProcessor
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected com.jme3.asset.AssetManagerprotected JmeBatchRenderBackendprotected intprotected booleanprotected com.jme3.input.InputManagerprotected InputSystemJmeprotected de.lessvoid.nifty.Niftyprotected RenderDeviceJmeprotected com.jme3.renderer.Rendererprotected com.jme3.renderer.RenderManagerprotected NiftyJmeDisplay.ResourceLocationJmeprotected SoundDeviceJmeprotected com.jme3.renderer.ViewPortprotected int -
Constructor Summary
ConstructorsConstructorDescriptionNiftyJmeDisplay(com.jme3.asset.AssetManager assetManager, com.jme3.input.InputManager inputManager, com.jme3.audio.AudioRenderer audioRenderer, com.jme3.renderer.ViewPort vp) Create a standard NiftyJmeDisplay.NiftyJmeDisplay(com.jme3.asset.AssetManager assetManager, com.jme3.input.InputManager inputManager, com.jme3.audio.AudioRenderer audioRenderer, com.jme3.renderer.ViewPort viewport, int atlasWidth, int atlasHeight) Deprecated.NiftyJmeDisplay(com.jme3.asset.AssetManager assetManager, com.jme3.input.InputManager inputManager, com.jme3.audio.AudioRenderer audioRenderer, com.jme3.renderer.ViewPort vp, com.jme3.texture.image.ColorSpace colorSpace) Create a standard NiftyJmeDisplay. -
Method Summary
Modifier and TypeMethodDescriptionvoidcleanup()de.lessvoid.nifty.NiftygetNifty()voidinitialize(com.jme3.renderer.RenderManager rm, com.jme3.renderer.ViewPort vp) booleanstatic NiftyJmeDisplaynewNiftyJmeDisplay(com.jme3.asset.AssetManager assetManager, com.jme3.input.InputManager inputManager, com.jme3.audio.AudioRenderer audioRenderer, com.jme3.renderer.ViewPort viewport) Create a new NiftyJmeDisplay for use with the Batched Nifty Renderer.static NiftyJmeDisplaynewNiftyJmeDisplay(com.jme3.asset.AssetManager assetManager, com.jme3.input.InputManager inputManager, com.jme3.audio.AudioRenderer audioRenderer, com.jme3.renderer.ViewPort viewport, de.lessvoid.nifty.render.batch.BatchRenderConfiguration batchRenderConfiguration) Create a new NiftyJmeDisplay for use with the Batched Nifty Renderer.voidpostFrame(com.jme3.texture.FrameBuffer out) voidpostQueue(com.jme3.renderer.queue.RenderQueue rq) voidpreFrame(float tpf) voidreshape(com.jme3.renderer.ViewPort vp, int w, int h) voidsetProfiler(com.jme3.profile.AppProfiler profiler) voidsimulateKeyEvent(com.jme3.input.event.KeyInputEvent event) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.jme3.post.SceneProcessor
rescale
-
Field Details
-
inited
protected boolean inited -
nifty
protected de.lessvoid.nifty.Nifty nifty -
assetManager
protected com.jme3.asset.AssetManager assetManager -
renderManager
protected com.jme3.renderer.RenderManager renderManager -
inputManager
protected com.jme3.input.InputManager inputManager -
renderDev
-
batchRendererBackend
-
inputSys
-
soundDev
-
renderer
protected com.jme3.renderer.Renderer renderer -
vp
protected com.jme3.renderer.ViewPort vp -
resourceLocation
-
w
protected int w -
h
protected int h
-
-
Constructor Details
-
NiftyJmeDisplay
public NiftyJmeDisplay() -
NiftyJmeDisplay
public NiftyJmeDisplay(com.jme3.asset.AssetManager assetManager, com.jme3.input.InputManager inputManager, com.jme3.audio.AudioRenderer audioRenderer, com.jme3.renderer.ViewPort viewport, int atlasWidth, int atlasHeight) Deprecated.use the static factory methodsnewNiftyJmeDisplay(com.jme3.asset.AssetManager, com.jme3.input.InputManager, com.jme3.audio.AudioRenderer, com.jme3.renderer.ViewPort)ornewNiftyJmeDisplay(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.Create a new NiftyJmeDisplay for use with the Batched Nifty Renderer (improved Nifty rendering performance). Nifty will use a single texture of the given dimensions (see atlasWidth and atlasHeight parameters). Every graphical asset you're rendering through Nifty will be placed into this big texture. The goal is to render all Nifty components in a single (or at least very few) draw calls. This should speed up rendering quite a bit. Currently you have to make sure to not use more image space than this single texture provides. However, Nifty tries to be smart about this and internally will make sure that only the images are uploaded that your GUI really needs. So in general this shouldn't be an issue. A complete re-organisation of the texture atlas happens when a Nifty screen ends and another begins. Dynamically adding images while a screen is running is supported as well.- Parameters:
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)
-
NiftyJmeDisplay
public NiftyJmeDisplay(com.jme3.asset.AssetManager assetManager, com.jme3.input.InputManager inputManager, com.jme3.audio.AudioRenderer audioRenderer, com.jme3.renderer.ViewPort vp) Create a standard NiftyJmeDisplay. This uses the old Nifty renderer. It's probably slower than the batched renderer and is mainly here for backwards compatibility. Nifty colors are assumed to be in Linear colorspace (no gamma correction).- Parameters:
assetManager- jME AssetManagerinputManager- jME InputManageraudioRenderer- jME AudioRenderervp- Viewport to use
-
NiftyJmeDisplay
public NiftyJmeDisplay(com.jme3.asset.AssetManager assetManager, com.jme3.input.InputManager inputManager, com.jme3.audio.AudioRenderer audioRenderer, com.jme3.renderer.ViewPort vp, com.jme3.texture.image.ColorSpace colorSpace) Create a standard NiftyJmeDisplay. This uses the old Nifty renderer. It's probably slower than the batched renderer and is mainly here for backwards compatibility.- Parameters:
assetManager- jME AssetManagerinputManager- jME InputManageraudioRenderer- jME AudioRenderervp- Viewport to usecolorSpace- the ColorSpace to use for Nifty colors (sRGB or Linear)
-
-
Method Details
-
newNiftyJmeDisplay
public static NiftyJmeDisplay newNiftyJmeDisplay(com.jme3.asset.AssetManager assetManager, com.jme3.input.InputManager inputManager, com.jme3.audio.AudioRenderer audioRenderer, com.jme3.renderer.ViewPort viewport) Create a new NiftyJmeDisplay for use with the Batched Nifty Renderer. Nifty will use texture atlases for rendering. Every graphical asset you're rendering through Nifty will be placed into a texture atlas. The goal is to render all Nifty components in a single (or at least very few) draw calls. This should speed up rendering quite a bit. This call will use a default BatchRenderConfiguration for Nifty. See the other methodnewNiftyJmeDisplay(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.- Parameters:
assetManager- jME AssetManagerinputManager- jME InputManageraudioRenderer- jME AudioRendererviewport- Viewport to use- Returns:
- new NiftyJmeDisplay instance
-
newNiftyJmeDisplay
public static NiftyJmeDisplay newNiftyJmeDisplay(com.jme3.asset.AssetManager assetManager, com.jme3.input.InputManager inputManager, com.jme3.audio.AudioRenderer audioRenderer, com.jme3.renderer.ViewPort viewport, de.lessvoid.nifty.render.batch.BatchRenderConfiguration batchRenderConfiguration) Create a new NiftyJmeDisplay for use with the Batched Nifty Renderer. Nifty will use texture atlas for rendering. Every graphical asset you're rendering through Nifty will be placed into a texture atlas. The goal is to render all Nifty components in a single (or at least very few) draw calls. This should speed up rendering quite a bit.- Parameters:
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.- Returns:
- new NiftyJmeDisplay instance
-
initialize
public void initialize(com.jme3.renderer.RenderManager rm, com.jme3.renderer.ViewPort vp) - Specified by:
initializein interfacecom.jme3.post.SceneProcessor
-
getNifty
public de.lessvoid.nifty.Nifty getNifty() -
simulateKeyEvent
public void simulateKeyEvent(com.jme3.input.event.KeyInputEvent event) -
reshape
public void reshape(com.jme3.renderer.ViewPort vp, int w, int h) - Specified by:
reshapein interfacecom.jme3.post.SceneProcessor
-
isInitialized
public boolean isInitialized()- Specified by:
isInitializedin interfacecom.jme3.post.SceneProcessor
-
preFrame
public void preFrame(float tpf) - Specified by:
preFramein interfacecom.jme3.post.SceneProcessor
-
postQueue
public void postQueue(com.jme3.renderer.queue.RenderQueue rq) - Specified by:
postQueuein interfacecom.jme3.post.SceneProcessor
-
postFrame
public void postFrame(com.jme3.texture.FrameBuffer out) - Specified by:
postFramein interfacecom.jme3.post.SceneProcessor
-
cleanup
public void cleanup()- Specified by:
cleanupin interfacecom.jme3.post.SceneProcessor
-
setProfiler
public void setProfiler(com.jme3.profile.AppProfiler profiler) - Specified by:
setProfilerin interfacecom.jme3.post.SceneProcessor
-
newNiftyJmeDisplay(com.jme3.asset.AssetManager, com.jme3.input.InputManager, com.jme3.audio.AudioRenderer, com.jme3.renderer.ViewPort)ornewNiftyJmeDisplay(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.