Package org.jzy3d.plot3d.rendering.view
Class NativeRenderer
- java.lang.Object
-
- org.jzy3d.plot3d.rendering.view.NativeRenderer
-
- All Implemented Interfaces:
Renderer
public class NativeRenderer extends Object implements Renderer
TheNativeRenderer
object is aGLEventListener
, that makes openGL calls necessary to initialize and render aScene
for anICanvas
. One can activate OpenGl errors in console by setting debugGL to true in the constructor One can activate OpenGl feedback in console by setting traceGL to true in the constructor- Author:
- Martin Pernollet
-
-
Constructor Summary
Constructors Constructor Description NativeRenderer()
NativeRenderer(View view)
Initialize a Renderer attached to the given View.NativeRenderer(View view, boolean traceGL, boolean debugGL)
Initialize a Renderer attached to the given View, and activate GL trace and errors to console.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
display(ICanvas canvas)
Called when theGLAutoDrawable
requires a rendering.void
dispose(ICanvas canvas)
int
getHeight()
Return the height that was given after the last resize event.com.jogamp.opengl.util.texture.TextureData
getLastScreenshot()
int
getWidth()
Return the width that was given after the last resize event.void
init(ICanvas canvas)
Called when theGLAutoDrawable
is rendered for the first time.void
nextDisplayUpdateScreenshot()
void
reshape(ICanvas canvas, int x, int y, int width, int height)
Called when theGLAutoDrawable
is resized.protected void
updatePainterWithGL(com.jogamp.opengl.GLAutoDrawable canvas)
This method allows configuring theIPainter
with the currentGL
context provided by theGLAutoDrawable
.
-
-
-
Field Detail
-
view
protected View view
-
width
protected int width
-
height
protected int height
-
doScreenshotAtNextDisplay
protected boolean doScreenshotAtNextDisplay
-
image
protected com.jogamp.opengl.util.texture.TextureData image
-
traceGL
protected boolean traceGL
-
debugGL
protected boolean debugGL
-
-
Constructor Detail
-
NativeRenderer
public NativeRenderer(View view)
Initialize a Renderer attached to the given View.
-
NativeRenderer
public NativeRenderer()
-
NativeRenderer
public NativeRenderer(View view, boolean traceGL, boolean debugGL)
Initialize a Renderer attached to the given View, and activate GL trace and errors to console.
-
-
Method Detail
-
init
public void init(ICanvas canvas)
Called when theGLAutoDrawable
is rendered for the first time. When one calls Scene.init() function, this function is called and makes the OpenGL buffers initialization. Note: in this implementation, GL Exceptions are not triggered. To do so, make te following call at the beginning of the init() body:canvas.setGL( new DebugGL(canvas.getGL()) );
-
display
public void display(ICanvas canvas)
Called when theGLAutoDrawable
requires a rendering. All call to rendering methods should appear here.
-
reshape
public void reshape(ICanvas canvas, int x, int y, int width, int height)
Called when theGLAutoDrawable
is resized.
-
updatePainterWithGL
protected void updatePainterWithGL(com.jogamp.opengl.GLAutoDrawable canvas)
This method allows configuring theIPainter
with the currentGL
context provided by theGLAutoDrawable
. This may be usefull to override in case of a mocking GL (to avoid having the mock replaced by a real GL Context).- Parameters:
canvas
-
-
nextDisplayUpdateScreenshot
public void nextDisplayUpdateScreenshot()
-
getLastScreenshot
public com.jogamp.opengl.util.texture.TextureData getLastScreenshot()
-
getWidth
public int getWidth()
Return the width that was given after the last resize event.
-
getHeight
public int getHeight()
Return the height that was given after the last resize event.
-
-