Interface Renderer
- All Known Implementing Classes:
SpriteRenderer
public interface Renderer
Application supplied callback that drives the contents of a
RenderView.
The methods are always invoked on the platform render thread that owns the
GPU context; never touch Codename One UI components directly from these
callbacks. Use RenderView.requestRender() or
RenderView.setContinuous(boolean) to schedule frames.-
Method Summary
Modifier and TypeMethodDescriptionvoidonDispose(GraphicsDevice device) Invoked when the GPU context is being torn down (for example when the view is removed from the UI).voidonFrame(GraphicsDevice device) Invoked once per frame to render the scene.voidonInit(GraphicsDevice device) Invoked once after the GPU context and itsGraphicsDevicehave been created and are current.voidonResize(GraphicsDevice device, int width, int height) Invoked when the drawable surface size changes, including once after initialization.
-
Method Details
-
onInit
Invoked once after the GPU context and its
GraphicsDevicehave been created and are current. Allocate buffers, textures and materials here.Parameters
device: the graphics device bound to this view
-
onResize
Invoked when the drawable surface size changes, including once after initialization. Reconfigure projection matrices and viewports here.
Parameters
-
device: the graphics device bound to this view -
width: the new drawable width in pixels -
height: the new drawable height in pixels
-
-
onFrame
Invoked once per frame to render the scene. Issue draw calls against the supplied device.
Parameters
device: the graphics device bound to this view
-
onDispose
Invoked when the GPU context is being torn down (for example when the view is removed from the UI). Release any resources that are not owned by the device. May be invoked with a null device when the context was lost.
Parameters
device: the graphics device bound to this view, or null if the context was already lost
-