JOGL v2.6.0-rc-20250712
JOGL, High-Performance Graphics Binding for Java™ (public API).
com.jogamp.opengl.test.junit.jogl.demos.gl2.Gears Class Reference

Gears.java
author: Brian Paul (converted to Java by Ron Cemer and Sven Gothel) More...

Inheritance diagram for com.jogamp.opengl.test.junit.jogl.demos.gl2.Gears:
Collaboration diagram for com.jogamp.opengl.test.junit.jogl.demos.gl2.Gears:

Classes

class  GearsKeyAdapter
 
class  GearsMouseAdapter
 

Public Member Functions

 Gears (final int swapInterval)
 
 Gears ()
 
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 setVerbose (final boolean v)
 
void setFlipVerticalInGLOrientation (final boolean v)
 
void setSharedGears (final Gears shared)
 
int getGear1 ()
 
int getGear2 ()
 
int getGear3 ()
 
void init (final GLAutoDrawable drawable)
 Called by the drawable immediately after the OpenGL context is initialized. More...
 
boolean init (final GL2 gl)
 
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 reshape (final GL2 gl, final int tileX, final int tileY, final int tileWidth, final int tileHeight, final int imageWidth, final int imageHeight)
 
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 GL2 gl)
 
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 gear (final GL2 gl, final float inner_radius, final float outer_radius, final float width, final int teeth, final float tooth_depth)
 

Detailed Description

Gears.java
author: Brian Paul (converted to Java by Ron Cemer and Sven Gothel)

This version is equal to Brian Paul's version 1.2 1999/10/21

Definition at line 34 of file Gears.java.

Constructor & Destructor Documentation

◆ Gears() [1/2]

com.jogamp.opengl.test.junit.jogl.demos.gl2.Gears.Gears ( final int  swapInterval)

Definition at line 54 of file Gears.java.

◆ Gears() [2/2]

com.jogamp.opengl.test.junit.jogl.demos.gl2.Gears.Gears ( )

Definition at line 58 of file Gears.java.

Member Function Documentation

◆ addTileRendererNotify()

void com.jogamp.opengl.test.junit.jogl.demos.gl2.Gears.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 63 of file Gears.java.

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

◆ display() [1/2]

void com.jogamp.opengl.test.junit.jogl.demos.gl2.Gears.display ( final GL2  gl)

Definition at line 362 of file Gears.java.

Here is the call graph for this function:

◆ display() [2/2]

void com.jogamp.opengl.test.junit.jogl.demos.gl2.Gears.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 333 of file Gears.java.

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

◆ dispose()

void com.jogamp.opengl.test.junit.jogl.demos.gl2.Gears.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 311 of file Gears.java.

Here is the call graph for this function:

◆ endTileRendering()

void com.jogamp.opengl.test.junit.jogl.demos.gl2.Gears.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 78 of file Gears.java.

◆ gear()

static void com.jogamp.opengl.test.junit.jogl.demos.gl2.Gears.gear ( final GL2  gl,
final float  inner_radius,
final float  outer_radius,
final float  width,
final int  teeth,
final float  tooth_depth 
)
static

Definition at line 417 of file Gears.java.

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

◆ getGear1()

int com.jogamp.opengl.test.junit.jogl.demos.gl2.Gears.getGear1 ( )
Returns
display list gear1

Definition at line 93 of file Gears.java.

Here is the caller graph for this function:

◆ getGear2()

int com.jogamp.opengl.test.junit.jogl.demos.gl2.Gears.getGear2 ( )
Returns
display list gear2

Definition at line 98 of file Gears.java.

Here is the caller graph for this function:

◆ getGear3()

int com.jogamp.opengl.test.junit.jogl.demos.gl2.Gears.getGear3 ( )
Returns
display list gear3

Definition at line 103 of file Gears.java.

Here is the caller graph for this function:

◆ init() [1/2]

boolean com.jogamp.opengl.test.junit.jogl.demos.gl2.Gears.init ( final GL2  gl)

Definition at line 155 of file Gears.java.

Here is the call graph for this function:

◆ init() [2/2]

void com.jogamp.opengl.test.junit.jogl.demos.gl2.Gears.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 106 of file Gears.java.

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

◆ isInit()

final boolean com.jogamp.opengl.test.junit.jogl.demos.gl2.Gears.isInit ( )

Definition at line 242 of file Gears.java.

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

◆ removeTileRendererNotify()

void com.jogamp.opengl.test.junit.jogl.demos.gl2.Gears.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 69 of file Gears.java.

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

◆ reshape() [1/2]

void com.jogamp.opengl.test.junit.jogl.demos.gl2.Gears.reshape ( final GL2  gl,
final int  tileX,
final int  tileY,
final int  tileWidth,
final int  tileHeight,
final int  imageWidth,
final int  imageHeight 
)

Definition at line 262 of file Gears.java.

Here is the call graph for this function:

◆ reshape() [2/2]

void com.jogamp.opengl.test.junit.jogl.demos.gl2.Gears.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 245 of file Gears.java.

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

◆ reshapeTile()

void com.jogamp.opengl.test.junit.jogl.demos.gl2.Gears.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 253 of file Gears.java.

Here is the call graph for this function:

◆ setDoRotation()

void com.jogamp.opengl.test.junit.jogl.demos.gl2.Gears.setDoRotation ( final boolean  rotate)

Definition at line 82 of file Gears.java.

Here is the caller graph for this function:

◆ setFlipVerticalInGLOrientation()

void com.jogamp.opengl.test.junit.jogl.demos.gl2.Gears.setFlipVerticalInGLOrientation ( final boolean  v)

Definition at line 84 of file Gears.java.

Here is the caller graph for this function:

◆ setSharedGears()

void com.jogamp.opengl.test.junit.jogl.demos.gl2.Gears.setSharedGears ( final Gears  shared)

Definition at line 86 of file Gears.java.

Here is the caller graph for this function:

◆ setVerbose()

void com.jogamp.opengl.test.junit.jogl.demos.gl2.Gears.setVerbose ( final boolean  v)

Definition at line 83 of file Gears.java.

Here is the caller graph for this function:

◆ startTileRendering()

void com.jogamp.opengl.test.junit.jogl.demos.gl2.Gears.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 74 of file Gears.java.


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