Class Scene
- java.lang.Object
-
- com.jogamp.graph.ui.Scene
-
- All Implemented Interfaces:
Container
,GLEventListener
,EventListener
public final class Scene extends Object implements Container, GLEventListener
GraphUI SceneGraphUI is GPU based and resolution independent.
GraphUI is intended to become an immediate- and retained-mode API.
To utilize a Scene instance directly as a
GLEventListener
, user needs tosetClearParams(float[], int)
. Otherwise user may just call providedGLEventListener
from within their own workflow -GLEventListener.init(GLAutoDrawable)
-GLEventListener.reshape(GLAutoDrawable, int, int, int, int)
-GLEventListener.display(GLAutoDrawable)
-GLEventListener.dispose(GLAutoDrawable)
setPMVMatrixSetup(PMVMatrixSetup)
maybe used to provide a customPMVMatrix
setup.- See Also:
Shape
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
Scene.PMVMatrixSetup
Interface providinga method
to setupPMVMatrix
'sGLMatrixFunc.GL_PROJECTION
andGLMatrixFunc.GL_MODELVIEW
.
-
Field Summary
Fields Modifier and Type Field Description static float
DEFAULT_ANGLE
Default projection angle in degrees value is 45.0.static float
DEFAULT_SCENE_DIST
Default scene distance on z-axis to projection is -1/5f.static float
DEFAULT_ZFAR
Default projection z-far value is 7000.static float
DEFAULT_ZNEAR
Default projection z-near value is 0.1.
-
Constructor Summary
Constructors Constructor Description Scene()
Create a new scene with an internally created RegionRenderer and using default valuesDEFAULT_SCENE_DIST
,DEFAULT_ANGLE
,DEFAULT_ZNEAR
andDEFAULT_ZFAR
.Scene(RegionRenderer renderer)
Create a new scene taking ownership of the given RegionRenderer and using default valuesDEFAULT_SCENE_DIST
,DEFAULT_ANGLE
,DEFAULT_ZNEAR
andDEFAULT_ZFAR
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addShape(Shape s)
void
addShapes(Collection<? extends Shape> shapes)
void
attachInputListenerTo(GLWindow window)
boolean
contains(Shape s)
void
detachInputListenerFrom(GLWindow window)
void
display(GLAutoDrawable drawable)
Called by the drawable to initiate OpenGL rendering by the client.void
dispose(GLAutoDrawable drawable)
boolean
forAll(Shape.Visitor1 v)
Traverses through the graph and applyShape.Visitor1.visit(Shape)
for each, stop if it returns true.boolean
forAll(PMVMatrix pmv, Shape.Visitor2 v)
Traverses through the graph and applyShape.Visitor2.visit(Shape, PMVMatrix)
for each, stop if it returns true.boolean
forOne(PMVMatrix pmv, Shape shape, Runnable action)
Traverses through the graph up untilshape
and applyaction
on it.boolean
forSortedAll(Comparator<Shape> sortComp, PMVMatrix pmv, Shape.Visitor2 v)
Traverses through the graph and applyVisitor#visit(Shape, PMVMatrix)
for each, stop if it returns true.Shape
getActiveShape()
AABBox
getBounds()
Describing the scene's object model-dimensions of the plane at scene-distance covering the visible viewport rectangle.AABBox
getBounds(PMVMatrix pmv, Shape shape)
float[]
getClearColor()
Returns theglClearColor(..)
arguments, seesetClearParams(float[], int)
.int
getClearMask()
Returns theglClear(..)
mask, seesetClearParams(float[], int)
.static Scene.PMVMatrixSetup
getDefaultPMVMatrixSetup()
Return the defaultScene.PMVMatrixSetup
.int
getHeight()
Returns thegetViewport()
's height, set after initialreshape(GLAutoDrawable, int, int, int, int)
.PMVMatrix
getMatrix()
Borrow the currentPMVMatrix
.Scene.PMVMatrixSetup
getPMVMatrixSetup()
Return the default orsetPMVMatrixSetup(PMVMatrixSetup)
Scene.PMVMatrixSetup
.RegionRenderer
getRenderer()
Returns the associated RegionRendererint
getSampleCount()
int
getScreenshotCount()
Return the number ofnextScreenshotFile(String, String, int, GLCapabilitiesImmutable, String)
calls.Shape
getShapeByIdx(int id)
Shape
getShapeByName(int name)
List<Shape>
getShapes()
static String
getStatusText(FPSCounter fpsCounter)
Return a formatted status string containing avg fps and avg frame duration.String
getStatusText(GLAutoDrawable glad, int renderModes, int quality, float dpi)
Return a formatted status string containing avg fps and avg frame duration.Recti
getViewport()
Borrows the current int[4] viewport w/o copying.Recti
getViewport(Recti target)
Copies the current int[4] viewport in given target and returns it for chaining.int
getWidth()
Returns thegetViewport()
's width, set after initialreshape(GLAutoDrawable, int, int, int, int)
.void
init(GLAutoDrawable drawable)
Called by the drawable immediately after the OpenGL context is initialized.boolean
isFrustumCullingEnabled()
Return whetherfrustum culling
is enabled.void
markAllShapesDirty()
File
nextScreenshotFile(String dir, String prefix, int renderModes, GLCapabilitiesImmutable caps, String contentDetail)
Return the unique next technical screenshot PNGFile
instance as follows:Shape
pickShape(PMVMatrix pmv, int glWinX, int glWinY, Vec3f objPos, Shape[] shape, Runnable runnable)
void
pickShapeGL(int glWinX, int glWinY, Vec3f objPos, Shape[] shape, Runnable runnable)
Attempt to pick aShape
using the OpenGL false color rendering.void
releaseActiveShape()
void
removeAllShapes()
Removes all contained shapes, w/odestroying
them.void
removeAllShapes(GL2ES2 gl)
Removes all given shapes and destroys them.Shape
removeShape(int idx)
Removes shape at given index, w/odestroying
them.Shape
removeShape(Shape s)
Removes given shape, w/odestroying
them.void
removeShape(GL2ES2 gl, Shape s)
Removes given shape and destroy it.void
removeShapes(GL2ES2 gl, Collection<? extends Shape> shapes)
Removes all given shapes and destroys them.void
removeShapes(Collection<? extends Shape> shapes)
Removes all given shapes, w/odestroying
them.void
reshape(GLAutoDrawable drawable, int x, int y, int width, int height)
Reshape scene using#setupMatrix(PMVMatrix, int, int, int, int)
usingScene.PMVMatrixSetup
.void
screenshot(boolean wait, File file)
Write current read drawable (screen) to a file onon the display call
.void
screenshot(GL gl, File file)
Write current read drawable (screen) to a file.void
setAllShapesQuality(int q)
void
setAllShapesSharpness(float sharpness)
void
setClearParams(float[] clearColor, int clearMask)
Sets the clear parameter forglClearColor(..)
andglClear(..)
to be issued atdisplay(GLAutoDrawable)
.void
setDebugBorderBox(float v)
Sets the debugborder
thickness for all existing or added shapes, zero for no debug border (default).void
setFrustumCullingEnabled(boolean v)
Enable or disablePMVMatrix.getFrustum()
culling perShape
.void
setPMVMatrixSetup(Scene.PMVMatrixSetup setup)
Set a customScene.PMVMatrixSetup
.int
setSampleCount(int v)
void
setupMatrix(PMVMatrix pmv)
SetupPMVMatrix
GLMatrixFunc.GL_PROJECTION
andGLMatrixFunc.GL_MODELVIEW
using implicitgetViewport()
surface dimension by callinggetPMVMatrixSetup()
'sScene.PMVMatrixSetup.set(PMVMatrix, Recti)
.void
setupMatrix(PMVMatrix pmv, Recti viewport)
void
surfaceToPlaneSize(Recti viewport, float zNear, float zFar, float objOrthoDist, Vec2f objSceneSize)
Map given window surface-size to object coordinates relative to this scene using the give projection parameters.void
surfaceToPlaneSize(Recti viewport, Vec2f objSceneSize)
Map given window surface-size to object coordinates relative to this scene using the defaultScene.PMVMatrixSetup
, i.e.void
waitUntilDisplayed()
Blocks until firstdisplay(GLAutoDrawable)
has completed after construction or {@link #dispose(GLAutoDrawable).static void
winToPlaneCoord(PMVMatrix pmv, Recti viewport, float zNear, float zFar, float winX, float winY, float objOrthoZ, Vec3f objPos)
void
winToShapeCoord(Shape shape, int glWinX, int glWinY, PMVMatrix pmv, Vec3f objPos, Runnable runnable)
CallingShape#winToObjCoord(Scene, int, int, float[])
, retrieving its Shape object position.
-
-
-
Field Detail
-
DEFAULT_SCENE_DIST
public static final float DEFAULT_SCENE_DIST
Default scene distance on z-axis to projection is -1/5f.- See Also:
- Constant Field Values
-
DEFAULT_ANGLE
public static final float DEFAULT_ANGLE
Default projection angle in degrees value is 45.0.- See Also:
- Constant Field Values
-
DEFAULT_ZNEAR
public static final float DEFAULT_ZNEAR
Default projection z-near value is 0.1.- See Also:
- Constant Field Values
-
DEFAULT_ZFAR
public static final float DEFAULT_ZFAR
Default projection z-far value is 7000.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Scene
public Scene()
Create a new scene with an internally created RegionRenderer and using default valuesDEFAULT_SCENE_DIST
,DEFAULT_ANGLE
,DEFAULT_ZNEAR
andDEFAULT_ZFAR
.
-
Scene
public Scene(RegionRenderer renderer)
Create a new scene taking ownership of the given RegionRenderer and using default valuesDEFAULT_SCENE_DIST
,DEFAULT_ANGLE
,DEFAULT_ZNEAR
andDEFAULT_ZFAR
.
-
-
Method Detail
-
getRenderer
public RegionRenderer getRenderer()
Returns the associated RegionRenderer
-
setClearParams
public final void setClearParams(float[] clearColor, int clearMask)
Sets the clear parameter forglClearColor(..)
andglClear(..)
to be issued atdisplay(GLAutoDrawable)
. Without setting these parameter, user has to issueglClearColor(..)
andglClear(..)
before callingdisplay(GLAutoDrawable)
.- Parameters:
clearColor
-glClearColor(..)
argumentsclearMask
-glClear(..)
mask, default isGL.GL_COLOR_BUFFER_BIT
|GL.GL_DEPTH_BUFFER_BIT
-
getClearColor
public final float[] getClearColor()
Returns theglClearColor(..)
arguments, seesetClearParams(float[], int)
.
-
getClearMask
public final int getClearMask()
Returns theglClear(..)
mask, seesetClearParams(float[], int)
.
-
setFrustumCullingEnabled
public final void setFrustumCullingEnabled(boolean v)
Description copied from interface:Container
Enable or disablePMVMatrix.getFrustum()
culling perShape
. Default is disabled.- Specified by:
setFrustumCullingEnabled
in interfaceContainer
-
isFrustumCullingEnabled
public final boolean isFrustumCullingEnabled()
Description copied from interface:Container
Return whetherfrustum culling
is enabled.- Specified by:
isFrustumCullingEnabled
in interfaceContainer
-
attachInputListenerTo
public void attachInputListenerTo(GLWindow window)
-
detachInputListenerFrom
public void detachInputListenerFrom(GLWindow window)
-
removeShape
public Shape removeShape(Shape s)
Description copied from interface:Container
Removes given shape, w/odestroying
them.- Specified by:
removeShape
in interfaceContainer
- Returns:
- the removed shape or null if not contained
-
removeShape
public Shape removeShape(int idx)
Description copied from interface:Container
Removes shape at given index, w/odestroying
them.- Specified by:
removeShape
in interfaceContainer
- Returns:
- the removed shape
-
addShapes
public void addShapes(Collection<? extends Shape> shapes)
-
removeShapes
public void removeShapes(Collection<? extends Shape> shapes)
Description copied from interface:Container
Removes all given shapes, w/odestroying
them.- Specified by:
removeShapes
in interfaceContainer
-
removeShapes
public void removeShapes(GL2ES2 gl, Collection<? extends Shape> shapes)
Removes all given shapes and destroys them.
-
removeAllShapes
public void removeAllShapes()
Description copied from interface:Container
Removes all contained shapes, w/odestroying
them.- Specified by:
removeAllShapes
in interfaceContainer
-
removeAllShapes
public void removeAllShapes(GL2ES2 gl)
Removes all given shapes and destroys them.
-
getShapeByIdx
public Shape getShapeByIdx(int id)
-
getShapeByName
public Shape getShapeByName(int name)
-
getSampleCount
public int getSampleCount()
-
setSampleCount
public int setSampleCount(int v)
-
setAllShapesQuality
public void setAllShapesQuality(int q)
-
setAllShapesSharpness
public void setAllShapesSharpness(float sharpness)
-
markAllShapesDirty
public void markAllShapesDirty()
-
setDebugBorderBox
public final void setDebugBorderBox(float v)
Sets the debugborder
thickness for all existing or added shapes, zero for no debug border (default).- Parameters:
v
- thickness debug border, zero for no border
-
init
public void init(GLAutoDrawable drawable)
Description copied from interface:GLEventListener
Called by the drawable immediately after the OpenGL context is initialized. Can be used to perform one-time OpenGL initialization per GLContext, such as setup of lights and display lists.Note that this method may be called more than once if the underlying OpenGL context for the GLAutoDrawable is destroyed and recreated, for example if a GLCanvas is removed from the widget hierarchy and later added again.
- Specified by:
init
in interfaceGLEventListener
-
reshape
public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height)
Reshape scene using#setupMatrix(PMVMatrix, int, int, int, int)
usingScene.PMVMatrixSetup
.Called by the drawable during the first repaint after the component has been resized.
The client can update it's viewport associated data and view volume of the window appropriately.
For efficiency the GL viewport has already been updated via
glViewport(x, y, width, height)
when this method is called.- Specified by:
reshape
in interfaceGLEventListener
- Parameters:
drawable
- the triggeringGLAutoDrawable
x
- lower left corner of the viewport rectangle in pixel unitsy
- lower left corner of the viewport rectangle in pixel unitswidth
- width of the viewport rectangle in pixel unitsheight
- height of the viewport rectangle in pixel units- See Also:
Scene.PMVMatrixSetup
,setPMVMatrixSetup(PMVMatrixSetup)
,#setupMatrix(PMVMatrix, int, int, int, int)
,getBounds()
,#getBoundsCenter()
-
display
public void display(GLAutoDrawable drawable)
Description copied from interface:GLEventListener
Called by the drawable to initiate OpenGL rendering by the client. After all GLEventListeners have been notified of a display event, the drawable will swap its buffers ifsetAutoSwapBufferMode
is enabled.- Specified by:
display
in interfaceGLEventListener
-
waitUntilDisplayed
public void waitUntilDisplayed()
Blocks until firstdisplay(GLAutoDrawable)
has completed after construction or {@link #dispose(GLAutoDrawable).
-
dispose
public void dispose(GLAutoDrawable drawable)
Disposes alladded
Shape
s.Implementation also issues
RegionRenderer.destroy(GL2ES2)
if set anddetachInputListenerFrom(GLWindow)
in case the drawable is of typeGLWindow
.Notifies the listener to perform the release of all OpenGL resources per GLContext, such as memory buffers and GLSL programs.
Called by the drawable before the OpenGL context is destroyed by an external event, like a reconfiguration of the
GLAutoDrawable
closing an attached window, but also manually by callingdestroy
.Note that this event does not imply the end of life of the application. It could be produced with a followup call to
GLEventListener.init(GLAutoDrawable)
in case the GLContext has been recreated, e.g. due to a pixel configuration change in a multihead environment.- Specified by:
dispose
in interfaceGLEventListener
-
pickShape
public Shape pickShape(PMVMatrix pmv, int glWinX, int glWinY, Vec3f objPos, Shape[] shape, Runnable runnable)
Attempt to pick aShape
using the window coordinates and contained 'sAABBox
bounds
using a ray-intersection algorithm.If
Shape
was found the given action is performed.Method performs on current thread and returns after probing every
Shape
.- Parameters:
pmv
- a newPMVMatrix
which willbe setup
,shape-transformed
and can be reused by the caller and runnable.glWinX
- window X coordinate, bottom-left originglWinY
- window Y coordinate, bottom-left originobjPos
- storage for found object position in model-space of foundShape
shape
- storage for foundShape
or nullrunnable
- the action to perform ifShape
was found- Returns:
- picked Shape if any or null as stored in
shape
-
pickShapeGL
public void pickShapeGL(int glWinX, int glWinY, Vec3f objPos, Shape[] shape, Runnable runnable)
-
winToShapeCoord
public void winToShapeCoord(Shape shape, int glWinX, int glWinY, PMVMatrix pmv, Vec3f objPos, Runnable runnable)
CallingShape#winToObjCoord(Scene, int, int, float[])
, retrieving its Shape object position.- Parameters:
shape
-glWinX
- in GL window coordinates, origin bottom-leftglWinY
- in GL window coordinates, origin bottom-leftpmv
- a newPMVMatrix
which willbe setup
,shape-transformed
and can be reused by the caller and runnable.objPos
- resulting object positionrunnable
- action
-
forOne
public boolean forOne(PMVMatrix pmv, Shape shape, Runnable action)
Traverses through the graph up untilshape
and applyaction
on it.- Specified by:
forOne
in interfaceContainer
- Parameters:
pmv
-PMVMatrix
, which shall be properly initialized, e.g. viasetupMatrix(PMVMatrix)
shape
-action
-- Returns:
- true to signal operation complete, i.e.
shape
found, otherwise false
-
forAll
public boolean forAll(PMVMatrix pmv, Shape.Visitor2 v)
Traverses through the graph and applyShape.Visitor2.visit(Shape, PMVMatrix)
for each, stop if it returns true.- Specified by:
forAll
in interfaceContainer
- Parameters:
pmv
-PMVMatrix
, which shall be properly initialized, e.g. viasetupMatrix(PMVMatrix)
v
-- Returns:
- true to signal operation complete and to stop traversal, i.e.
Shape.Visitor2.visit(Shape, PMVMatrix)
returned true, otherwise false
-
forAll
public boolean forAll(Shape.Visitor1 v)
Traverses through the graph and applyShape.Visitor1.visit(Shape)
for each, stop if it returns true.- Specified by:
forAll
in interfaceContainer
- Parameters:
v
-- Returns:
- true to signal operation complete and to stop traversal, i.e.
Shape.Visitor1.visit(Shape)
returned true, otherwise false
-
forSortedAll
public boolean forSortedAll(Comparator<Shape> sortComp, PMVMatrix pmv, Shape.Visitor2 v)
Traverses through the graph and applyVisitor#visit(Shape, PMVMatrix)
for each, stop if it returns true. EachContainer
level is sorted usingsortComp
- Specified by:
forSortedAll
in interfaceContainer
- Parameters:
sortComp
-pmv
-v
-- Returns:
- true to signal operation complete and to stop traversal, i.e.
Shape.Visitor2.visit(Shape, PMVMatrix)
returned true, otherwise false
-
getPMVMatrixSetup
public final Scene.PMVMatrixSetup getPMVMatrixSetup()
Return the default orsetPMVMatrixSetup(PMVMatrixSetup)
Scene.PMVMatrixSetup
.
-
setPMVMatrixSetup
public final void setPMVMatrixSetup(Scene.PMVMatrixSetup setup)
Set a customScene.PMVMatrixSetup
.
-
getDefaultPMVMatrixSetup
public static Scene.PMVMatrixSetup getDefaultPMVMatrixSetup()
Return the defaultScene.PMVMatrixSetup
.
-
setupMatrix
public void setupMatrix(PMVMatrix pmv, Recti viewport)
SetupPMVMatrix
GLMatrixFunc.GL_PROJECTION
andGLMatrixFunc.GL_MODELVIEW
by callinggetPMVMatrixSetup()
'sScene.PMVMatrixSetup.set(PMVMatrix, Recti)
.- Parameters:
pmv
- thePMVMatrix
to setupRecti
- viewport
-
setupMatrix
public void setupMatrix(PMVMatrix pmv)
SetupPMVMatrix
GLMatrixFunc.GL_PROJECTION
andGLMatrixFunc.GL_MODELVIEW
using implicitgetViewport()
surface dimension by callinggetPMVMatrixSetup()
'sScene.PMVMatrixSetup.set(PMVMatrix, Recti)
.- Parameters:
pmv
- thePMVMatrix
to setup
-
getViewport
public final Recti getViewport(Recti target)
Copies the current int[4] viewport in given target and returns it for chaining. It is set after initialreshape(GLAutoDrawable, int, int, int, int)
.
-
getViewport
public Recti getViewport()
Borrows the current int[4] viewport w/o copying. It is set after initialreshape(GLAutoDrawable, int, int, int, int)
.
-
getWidth
public int getWidth()
Returns thegetViewport()
's width, set after initialreshape(GLAutoDrawable, int, int, int, int)
.
-
getHeight
public int getHeight()
Returns thegetViewport()
's height, set after initialreshape(GLAutoDrawable, int, int, int, int)
.
-
getBounds
public AABBox getBounds()
Describing the scene's object model-dimensions of the plane at scene-distance covering the visible viewport rectangle.The value is evaluated at
reshape(GLAutoDrawable, int, int, int, int)
viaAABBox.getWidth()
andAABBox.getHeight()
define scene's dimension covered by surface size.AABBox
is setup viagetPMVMatrixSetup()
'sScene.PMVMatrixSetup.setPlaneBox(AABBox, PMVMatrix, Recti)
.The default
Scene.PMVMatrixSetup
implementation scales to normalized plane dimensions, 1 for the greater of width and height.
-
winToPlaneCoord
public static void winToPlaneCoord(PMVMatrix pmv, Recti viewport, float zNear, float zFar, float winX, float winY, float objOrthoZ, Vec3f objPos)
- Parameters:
pmv
-viewport
-zNear
-zFar
-winX
-winY
-objOrthoZ
-objPos
- float[3] storage for object coord resultwinZ
-
-
surfaceToPlaneSize
public void surfaceToPlaneSize(Recti viewport, float zNear, float zFar, float objOrthoDist, Vec2f objSceneSize)
Map given window surface-size to object coordinates relative to this scene using the give projection parameters.- Parameters:
viewport
- viewport rectanglezNear
- customDEFAULT_ZNEAR
zFar
- customDEFAULT_ZFAR
objOrthoDist
- customDEFAULT_SCENE_DIST
objSceneSize
- Vec2f storage for object surface size result
-
surfaceToPlaneSize
public void surfaceToPlaneSize(Recti viewport, Vec2f objSceneSize)
Map given window surface-size to object coordinates relative to this scene using the defaultScene.PMVMatrixSetup
, i.e.DEFAULT_ZNEAR
,DEFAULT_ZFAR
andDEFAULT_SCENE_DIST
- Parameters:
viewport
- viewport rectangleobjSceneSize
- Vec2f storage for object surface size result
-
getActiveShape
public final Shape getActiveShape()
-
releaseActiveShape
public void releaseActiveShape()
-
getStatusText
public String getStatusText(GLAutoDrawable glad, int renderModes, int quality, float dpi)
Return a formatted status string containing avg fps and avg frame duration.- Parameters:
glad
- GLAutoDrawable instance for FPSCounter, its chosen GLCapabilities and its GL's swap-intervalrenderModes
- render modes forRegion.getRenderModeString(int, int, int)
quality
- the Graph-Curve quality setting or -1 to be ignoreddpi
- the monitor's DPI (vertical preferred)- Returns:
- formatted status string
-
getStatusText
public static String getStatusText(FPSCounter fpsCounter)
Return a formatted status string containing avg fps and avg frame duration.- Parameters:
fpsCounter
- the counter, must not be null- Returns:
- formatted status string
-
nextScreenshotFile
public File nextScreenshotFile(String dir, String prefix, int renderModes, GLCapabilitiesImmutable caps, String contentDetail)
Return the unique next technical screenshot PNGFile
instance as follows:filename = [{dir}][{prefix}-]
Implementation incrementsRegion.getRenderModeString(int, int, int)
[-{contentDetails}]-snap{screenShotCount}-{resolution}.pnggetScreenshotCount()
.- Parameters:
dir
- the target directory, may be `null` or an empty stringprefix
- the prefix, may be `null` or an empty stringrenderModes
- the used Graph renderModes, seecreate(..)
caps
- the usedGLCapabilitiesImmutable
used to retrieved the full-screen AA (fsaa)GLCapabilitiesImmutable.getNumSamples()
contentDetail
- user content details to be added at the end but beforegetScreenshotCount()
, may be `null` or an empty string- Returns:
- a unique descriptive screenshot filename
- See Also:
screenshot(GL, File)
,screenshot(boolean, File)
,getScreenshotCount()
-
getScreenshotCount
public int getScreenshotCount()
Return the number ofnextScreenshotFile(String, String, int, GLCapabilitiesImmutable, String)
calls.
-
screenshot
public void screenshot(GL gl, File file)
Write current read drawable (screen) to a file.Best to be
invoked on the display call
, see#screenshot(boolean, String)
.- Parameters:
gl
- current GL objectfile
- the target file to be used, consider usingnextScreenshotFile(String, String, int, GLCapabilitiesImmutable, String)
- See Also:
nextScreenshotFile(String, String, int, GLCapabilitiesImmutable, String)
,getScreenshotCount()
,screenshot(boolean, File)
-
screenshot
public void screenshot(boolean wait, File file)
Write current read drawable (screen) to a file onon the display call
.- Parameters:
wait
- if true block until execution of screenshotGLRunnable
is finished, otherwise return immediately w/o waitingfile
- the target file to be used, consider usingnextScreenshotFile(String, String, int, GLCapabilitiesImmutable, String)
- See Also:
nextScreenshotFile(String, String, int, GLCapabilitiesImmutable, String)
,getScreenshotCount()
,screenshot(GL, File)
-
-