JOGL v2.6.0-rc-20250706
JOGL, High-Performance Graphics Binding for Java™ (public API).
com.jogamp.opengl.demos.es2.GearsES2 Class Reference

GearsES2.java
More...

Inheritance diagram for com.jogamp.opengl.demos.es2.GearsES2:
Collaboration diagram for com.jogamp.opengl.demos.es2.GearsES2:

Classes

class  GearsKeyAdapter
 
class  GearsMouseAdapter
 

Public Member Functions

 GearsES2 (final int swapInterval)
 
 GearsES2 ()
 
void addTileRendererNotify (final TileRendererBase tr)
 The owning GLAutoDrawable is attached to the given TileRendererBase instance. More...
 
void removeTileRendererNotify (final TileRendererBase tr)
 The owning GLAutoDrawable is detached from the given TileRendererBase instance. More...
 
void startTileRendering (final TileRendererBase tr)
 Called by the TileRendererBase during tile-rendering after TileRendererBase#beginTile(GL) and before reshapeTile(..). More...
 
void endTileRendering (final TileRendererBase tr)
 Called by the TileRenderer during tile-rendering after TileRendererBase#endTile(GL) and GLAutoDrawable#swapBuffers(). More...
 
void setDoRotation (final boolean rotate)
 
void setClearBuffers (final boolean v)
 
void setVerbose (final boolean v)
 
void setFlipVerticalInGLOrientation (final boolean v)
 
void setClearColor (final float[] clearColor)
 float[4] More...
 
void setGearsColors (final FloatBuffer gear1Color, final FloatBuffer gear2Color, final FloatBuffer gear3Color)
 
void setSharedGears (final GearsES2 shared)
 
void setSyncObjects (final Object sync)
 
float getRotX ()
 
float getRotY ()
 
void setRotX (final float v)
 
void setRotY (final float v)
 
GearsObjectES2 getGear1 ()
 
GearsObjectES2 getGear2 ()
 
GearsObjectES2 getGear3 ()
 
boolean usesSharedGears ()
 
void setUseMappedBuffers (final boolean v)
 
void setValidateBuffers (final boolean v)
 
PMVMatrix4f getPMVMatrix ()
 
boolean waitForInit (final boolean initialized) throws InterruptedException
 
void init (final GLAutoDrawable drawable)
 Called by the drawable immediately after the OpenGL context is initialized. More...
 
final boolean isInit ()
 
void reshape (final GLAutoDrawable glad, final int x, final int y, final int width, final int height)
 Called by the drawable during the first repaint after the component has been resized. More...
 
void reshapeTile (final TileRendererBase tr, final int tileX, final int tileY, final int tileWidth, final int tileHeight, final int imageWidth, final int imageHeight)
 Called by the TileRendererBase during tile-rendering via an attached GLAutoDrawable's GLAutoDrawable#display() call for each tile before display(GLAutoDrawable). More...
 
void setZ (final float zNear, final float zFar, final float zViewDist)
 
void reshapeForEye (final GLAutoDrawable drawable, final int x, final int y, final int width, final int height, final EyeParameter eyeParam, final ViewerPose viewerPose)
 Stereo capable specialization of reshape(GLAutoDrawable, int, int, int, int) for one StereoDeviceRenderer.Eye. More...
 
void dispose (final GLAutoDrawable drawable)
 Notifies the listener to perform the release of all OpenGL resources per GLContext, such as memory buffers and GLSL programs. More...
 
void display (final GLAutoDrawable drawable)
 Called by the drawable to initiate OpenGL rendering by the client. More...
 
void display (final GLAutoDrawable drawable, final int flags)
 Extended display method, allowing to pass a display flag, e.g. More...
 
void setGLStates (final GL2ES2 gl, final boolean enable)
 
String toString ()
 
KeyListener getKeyListener ()
 
MouseListener getMouseListener ()
 
void reshapeForEye (final GLAutoDrawable drawable, final int x, final int y, final int width, final int height, final EyeParameter eyeParam, final ViewerPose viewerPose)
 Stereo capable specialization of reshape(GLAutoDrawable, int, int, int, int) for one StereoDeviceRenderer.Eye. More...
 
void display (final GLAutoDrawable drawable, final int flags)
 Extended display method, allowing to pass a display flag, e.g. More...
 
void init (GLAutoDrawable drawable)
 Called by the drawable immediately after the OpenGL context is initialized. More...
 
void dispose (GLAutoDrawable drawable)
 Notifies the listener to perform the release of all OpenGL resources per GLContext, such as memory buffers and GLSL programs. More...
 
void display (GLAutoDrawable drawable)
 Called by the drawable to initiate OpenGL rendering by the client. More...
 
void reshape (GLAutoDrawable drawable, int x, int y, int width, int height)
 Called by the drawable during the first repaint after the component has been resized. More...
 
void addTileRendererNotify (TileRendererBase tr)
 The owning GLAutoDrawable is attached to the given TileRendererBase instance. More...
 
void removeTileRendererNotify (TileRendererBase tr)
 The owning GLAutoDrawable is detached from the given TileRendererBase instance. More...
 
void reshapeTile (TileRendererBase tr, int tileX, int tileY, int tileWidth, int tileHeight, int imageWidth, int imageHeight)
 Called by the TileRendererBase during tile-rendering via an attached GLAutoDrawable's GLAutoDrawable#display() call for each tile before display(GLAutoDrawable). More...
 
void startTileRendering (TileRendererBase tr)
 Called by the TileRendererBase during tile-rendering after TileRendererBase#beginTile(GL) and before reshapeTile(..). More...
 
void endTileRendering (TileRendererBase tr)
 Called by the TileRenderer during tile-rendering after TileRendererBase#endTile(GL) and GLAutoDrawable#swapBuffers(). More...
 

Static Public Member Functions

static void main (final String[] args)
 

Public Attributes

MouseListener gearsMouse = new GearsMouseAdapter()
 
KeyListener gearsKeys = new GearsKeyAdapter()
 

Additional Inherited Members

- Static Public Attributes inherited from com.jogamp.opengl.util.CustomGLEventListener
static final int DISPLAY_REPEAT = 1 << 0
 display flag: Repeat last produced image. More...
 
static final int DISPLAY_DONTCLEAR = 1 << 1
 display flag: Do not clear any target buffer, e.g. More...
 

Detailed Description

GearsES2.java

Author
Brian Paul (converted to Java by Ron Cemer and Sven Gothel)

Definition at line 71 of file GearsES2.java.

Constructor & Destructor Documentation

◆ GearsES2() [1/2]

com.jogamp.opengl.demos.es2.GearsES2.GearsES2 ( final int  swapInterval)

Definition at line 108 of file GearsES2.java.

◆ GearsES2() [2/2]

com.jogamp.opengl.demos.es2.GearsES2.GearsES2 ( )

Definition at line 112 of file GearsES2.java.

Here is the caller graph for this function:

Member Function Documentation

◆ addTileRendererNotify()

void com.jogamp.opengl.demos.es2.GearsES2.addTileRendererNotify ( final TileRendererBase  tr)

The owning GLAutoDrawable is attached to the given TileRendererBase instance.

The GLContext of the TileRendererBase's attached GLAutoDrawable is not current.

Parameters
trthe associated TileRendererBase
See also
TileRendererBase::getAttachedDrawable()

Implements com.jogamp.opengl.util.TileRendererBase.TileRendererListener.

Definition at line 117 of file GearsES2.java.

Here is the call graph for this function:

◆ display() [1/2]

void com.jogamp.opengl.demos.es2.GearsES2.display ( final GLAutoDrawable  drawable)

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 if setAutoSwapBufferMode is enabled.

Implements com.jogamp.opengl.GLEventListener.

Definition at line 505 of file GearsES2.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ display() [2/2]

void com.jogamp.opengl.demos.es2.GearsES2.display ( final GLAutoDrawable  drawable,
final int  flags 
)

Extended display method, allowing to pass a display flag, e.g.

DISPLAY_REPEAT or DISPLAY_DONTCLEAR.

Method is usually called by a custom rendering loop, e.g. for manual stereo rendering or the like.

Parameters
drawable
flags

Implements com.jogamp.opengl.util.CustomGLEventListener.

Definition at line 510 of file GearsES2.java.

Here is the call graph for this function:

◆ dispose()

void com.jogamp.opengl.demos.es2.GearsES2.dispose ( final GLAutoDrawable  drawable)

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 calling destroy.

Note that this event does not imply the end of life of the application. It could be produced with a followup call to init(GLAutoDrawable) in case the GLContext has been recreated, e.g. due to a pixel configuration change in a multihead environment.

Implements com.jogamp.opengl.GLEventListener.

Definition at line 466 of file GearsES2.java.

Here is the call graph for this function:

◆ endTileRendering()

void com.jogamp.opengl.demos.es2.GearsES2.endTileRendering ( final TileRendererBase  tr)

Called by the TileRenderer during tile-rendering after TileRendererBase#endTile(GL) and GLAutoDrawable#swapBuffers().

If TileRendererBase is of type TileRenderer, method is called for the last tile of all tiles.
Otherwise, i.e. RandomTileRenderer, method is called for each particular tile.

The GLContext of the TileRenderer's attached GLAutoDrawable is current.

Parameters
trthe issuing TileRendererBase

Implements com.jogamp.opengl.util.TileRendererBase.TileRendererListener.

Definition at line 132 of file GearsES2.java.

◆ getGear1()

GearsObjectES2 com.jogamp.opengl.demos.es2.GearsES2.getGear1 ( )
Returns
gear1

Definition at line 168 of file GearsES2.java.

Here is the caller graph for this function:

◆ getGear2()

GearsObjectES2 com.jogamp.opengl.demos.es2.GearsES2.getGear2 ( )
Returns
gear2

Definition at line 173 of file GearsES2.java.

Here is the caller graph for this function:

◆ getGear3()

GearsObjectES2 com.jogamp.opengl.demos.es2.GearsES2.getGear3 ( )
Returns
gear3

Definition at line 178 of file GearsES2.java.

Here is the caller graph for this function:

◆ getKeyListener()

KeyListener com.jogamp.opengl.demos.es2.GearsES2.getKeyListener ( )

Definition at line 589 of file GearsES2.java.

◆ getMouseListener()

MouseListener com.jogamp.opengl.demos.es2.GearsES2.getMouseListener ( )

Definition at line 590 of file GearsES2.java.

◆ getPMVMatrix()

PMVMatrix4f com.jogamp.opengl.demos.es2.GearsES2.getPMVMatrix ( )

Definition at line 185 of file GearsES2.java.

◆ getRotX()

float com.jogamp.opengl.demos.es2.GearsES2.getRotX ( )

Definition at line 160 of file GearsES2.java.

◆ getRotY()

float com.jogamp.opengl.demos.es2.GearsES2.getRotY ( )

Definition at line 161 of file GearsES2.java.

◆ init()

void com.jogamp.opengl.demos.es2.GearsES2.init ( final GLAutoDrawable  drawable)

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.

Implements com.jogamp.opengl.GLEventListener.

Definition at line 207 of file GearsES2.java.

Here is the call graph for this function:

◆ isInit()

final boolean com.jogamp.opengl.demos.es2.GearsES2.isInit ( )

Definition at line 313 of file GearsES2.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ main()

static void com.jogamp.opengl.demos.es2.GearsES2.main ( final String[]  args)
static

Definition at line 700 of file GearsES2.java.

Here is the call graph for this function:

◆ removeTileRendererNotify()

void com.jogamp.opengl.demos.es2.GearsES2.removeTileRendererNotify ( final TileRendererBase  tr)

The owning GLAutoDrawable is detached from the given TileRendererBase instance.

The GLContext of the TileRendererBase's attached GLAutoDrawable is not current.

Parameters
trthe disassociated TileRendererBase
See also
TileRendererBase::getAttachedDrawable()

Implements com.jogamp.opengl.util.TileRendererBase.TileRendererListener.

Definition at line 123 of file GearsES2.java.

Here is the call graph for this function:

◆ reshape()

void com.jogamp.opengl.demos.es2.GearsES2.reshape ( final GLAutoDrawable  drawable,
final int  x,
final int  y,
final int  width,
final int  height 
)

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.

Parameters
drawablethe triggering GLAutoDrawable
xlower left corner of the viewport rectangle in pixel units
ylower left corner of the viewport rectangle in pixel units
widthwidth of the viewport rectangle in pixel units
heightheight of the viewport rectangle in pixel units

Implements com.jogamp.opengl.GLEventListener.

Definition at line 325 of file GearsES2.java.

Here is the call graph for this function:

◆ reshapeForEye()

void com.jogamp.opengl.demos.es2.GearsES2.reshapeForEye ( final GLAutoDrawable  drawable,
final int  x,
final int  y,
final int  width,
final int  height,
final EyeParameter  eyeParam,
final ViewerPose  viewerPose 
)

Stereo capable specialization of reshape(GLAutoDrawable, int, int, int, int) for one StereoDeviceRenderer.Eye.

Called by the stereo renderer before each display(GLAutoDrawable) or display(GLAutoDrawable, int) call.

The client can update it's viewport associated data and view volume of the window appropriately.

The client shall also update it's projection- and modelview matrices according to the given EyeParameter and ViewerPose.

For efficiency the GL viewport has already been updated via glViewport(x, y, width, height) when this method is called.

Parameters
drawablethe triggering GLAutoDrawable
xviewport x-coord in pixel units
yviewport y-coord in pixel units
widthviewport width in pixel units
heightviewport height in pixel units
eyeParamconstant eye parameter, i.e. FOV and IPD
viewerPosecurrent viewer position and orientation
See also
FloatUtil::makePerspective(float[], int, boolean, com.jogamp.math.FloatUtil.FovHVHalves, float, float)

Implements com.jogamp.opengl.util.stereo.StereoGLEventListener.

Definition at line 417 of file GearsES2.java.

Here is the call graph for this function:

◆ reshapeTile()

void com.jogamp.opengl.demos.es2.GearsES2.reshapeTile ( final TileRendererBase  tr,
final int  tileX,
final int  tileY,
final int  tileWidth,
final int  tileHeight,
final int  imageWidth,
final int  imageHeight 
)

Called by the TileRendererBase during tile-rendering via an attached GLAutoDrawable's GLAutoDrawable#display() call for each tile before display(GLAutoDrawable).

The PMV Matrix shall be reshaped according to the given

  • current tile-position
  • current tile-size
  • final image-size

The GL viewport is already set to origin 0/0 and the current tile-size.
See details in TileRendererBase#beginTile(GL).

The GLContext of the TileRendererBase's attached GLAutoDrawable is current.

Parameters
trthe issuing TileRendererBase
tileXthe current tile's x-pos
tileYthe current tile's y-pos
tileWidththe current tile's width
tileHeightthe current tile's height
imageWidththe final image width
imageHeightthe final image height
See also
TileRendererBase::getAttachedDrawable()

Implements com.jogamp.opengl.util.TileRendererBase.TileRendererListener.

Definition at line 333 of file GearsES2.java.

Here is the call graph for this function:

◆ setClearBuffers()

void com.jogamp.opengl.demos.es2.GearsES2.setClearBuffers ( final boolean  v)

Definition at line 137 of file GearsES2.java.

◆ setClearColor()

void com.jogamp.opengl.demos.es2.GearsES2.setClearColor ( final float[]  clearColor)

float[4]

Definition at line 142 of file GearsES2.java.

◆ setDoRotation()

void com.jogamp.opengl.demos.es2.GearsES2.setDoRotation ( final boolean  rotate)

Definition at line 136 of file GearsES2.java.

Here is the caller graph for this function:

◆ setFlipVerticalInGLOrientation()

void com.jogamp.opengl.demos.es2.GearsES2.setFlipVerticalInGLOrientation ( final boolean  v)

Definition at line 139 of file GearsES2.java.

◆ setGearsColors()

void com.jogamp.opengl.demos.es2.GearsES2.setGearsColors ( final FloatBuffer  gear1Color,
final FloatBuffer  gear2Color,
final FloatBuffer  gear3Color 
)

Definition at line 146 of file GearsES2.java.

◆ setGLStates()

void com.jogamp.opengl.demos.es2.GearsES2.setGLStates ( final GL2ES2  gl,
final boolean  enable 
)

Definition at line 568 of file GearsES2.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setRotX()

void com.jogamp.opengl.demos.es2.GearsES2.setRotX ( final float  v)

Definition at line 162 of file GearsES2.java.

◆ setRotY()

void com.jogamp.opengl.demos.es2.GearsES2.setRotY ( final float  v)

Definition at line 163 of file GearsES2.java.

◆ setSharedGears()

void com.jogamp.opengl.demos.es2.GearsES2.setSharedGears ( final GearsES2  shared)

Definition at line 152 of file GearsES2.java.

◆ setSyncObjects()

void com.jogamp.opengl.demos.es2.GearsES2.setSyncObjects ( final Object  sync)

Definition at line 156 of file GearsES2.java.

◆ setUseMappedBuffers()

void com.jogamp.opengl.demos.es2.GearsES2.setUseMappedBuffers ( final boolean  v)

Definition at line 182 of file GearsES2.java.

◆ setValidateBuffers()

void com.jogamp.opengl.demos.es2.GearsES2.setValidateBuffers ( final boolean  v)

Definition at line 183 of file GearsES2.java.

◆ setVerbose()

void com.jogamp.opengl.demos.es2.GearsES2.setVerbose ( final boolean  v)

Definition at line 138 of file GearsES2.java.

Here is the caller graph for this function:

◆ setZ()

void com.jogamp.opengl.demos.es2.GearsES2.setZ ( final float  zNear,
final float  zFar,
final float  zViewDist 
)

Definition at line 346 of file GearsES2.java.

Here is the caller graph for this function:

◆ startTileRendering()

void com.jogamp.opengl.demos.es2.GearsES2.startTileRendering ( final TileRendererBase  tr)

Called by the TileRendererBase during tile-rendering after TileRendererBase#beginTile(GL) and before reshapeTile(..).

If TileRendererBase is of type TileRenderer, method is called for the first tile of all tiles.
Otherwise, i.e. RandomTileRenderer, method is called for each particular tile.

The GLContext of the TileRenderer's attached GLAutoDrawable is current.

Parameters
trthe issuing TileRendererBase

Implements com.jogamp.opengl.util.TileRendererBase.TileRendererListener.

Definition at line 128 of file GearsES2.java.

◆ toString()

String com.jogamp.opengl.demos.es2.GearsES2.toString ( )

Definition at line 585 of file GearsES2.java.

◆ usesSharedGears()

boolean com.jogamp.opengl.demos.es2.GearsES2.usesSharedGears ( )

Definition at line 180 of file GearsES2.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ waitForInit()

boolean com.jogamp.opengl.demos.es2.GearsES2.waitForInit ( final boolean  initialized) throws InterruptedException
Returns
True if this GLEventListener became initialized within TIME_OUT 2s

Definition at line 196 of file GearsES2.java.

Member Data Documentation

◆ gearsKeys

KeyListener com.jogamp.opengl.demos.es2.GearsES2.gearsKeys = new GearsKeyAdapter()

Definition at line 95 of file GearsES2.java.

◆ gearsMouse

MouseListener com.jogamp.opengl.demos.es2.GearsES2.gearsMouse = new GearsMouseAdapter()

Definition at line 94 of file GearsES2.java.


The documentation for this class was generated from the following file: