Interface VRRenderer
Application supplied callback that draws the scene for a VRView. Like
com.codename1.gpu.Renderer, every method runs on the platform render
thread that owns the GPU context - never touch Codename One UI components
from these callbacks.
The view clears the frame, sets the per-eye viewport and camera, then
invokes #onEyeFrame(GraphicsDevice, VREye, Camera) once per eye (twice
per frame in stereo, once with VREye#CENTER in mono). Draw the same
scene for every eye; the camera differences produce the stereo effect.
-
Method Summary
Modifier and TypeMethodDescriptionvoidonDispose(GraphicsDevice device) Invoked when the GPU context is being torn down.voidonEyeFrame(GraphicsDevice device, VREye eye, Camera eyeCamera) Invoked once per eye per frame to render the scene.voidonInit(GraphicsDevice device) Invoked once after the GPU context is created.
-
Method Details
-
onInit
Invoked once after the GPU context is created. Allocate buffers, textures and materials here.
Parameters
device: the graphics device bound to this view
-
onEyeFrame
Invoked once per eye per frame to render the scene. The viewport and camera are already configured for this eye.
Parameters
-
device: the graphics device bound to this view -
eye: which eye is being rendered -
eyeCamera: the camera for this eye, already applied to the device
-
-
onDispose
Invoked when the GPU context is being torn down. Release resources not owned by the device. May be invoked with a null device when the context was lost.
Parameters
device: the graphics device, or null if the context was lost
-