Class GpuImplementation
Per-platform backend for the portable 3D GPU API. A platform that supports
com.codename1.gpu.RenderView returns a single GpuImplementation from
CodenameOneImplementation.getGpuImplementation(); platforms without a 3D
backend return null. Grouping the peer factory and its lifecycle hooks into
one class lets each port segregate all of its GPU wiring in one place instead
of scattering individual overrides across the platform implementation.
This type is internal: applications interact with the GPU API through
RenderView and com.codename1.gpu.GraphicsDevice, never with this class.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract PeerComponentcreatePeer(RenderView view) Creates the native GPU peer that backs aRenderView.abstract voidrequestRender(PeerComponent peer) Requests that a GPU peer render a single frame.abstract voidsetContinuous(PeerComponent peer, boolean continuous) Sets whether a GPU peer renders continuously or only on demand.
-
Constructor Details
-
GpuImplementation
public GpuImplementation()
-
-
Method Details
-
createPeer
Creates the native GPU peer that backs a
RenderView. The peer owns the platform GPU context and drives the view'sRenderer.Parameters
view: the render view requesting a peer
Returns
the native GPU peer, or null if a peer could not be created
-
setContinuous
Sets whether a GPU peer renders continuously or only on demand.
Parameters
-
peer: a peer previously returned fromcreatePeer -
continuous: true to render every frame
-
-
requestRender
Requests that a GPU peer render a single frame. No effect in continuous mode.
Parameters
peer: a peer previously returned fromcreatePeer
-