org.xith3d.render.jsr231
Class CanvasPeerImplBase

java.lang.Object
  extended by org.xith3d.render.CanvasPeer
      extended by org.xith3d.render.jsr231.CanvasPeerImplBase
All Implemented Interfaces:
org.jagatoo.input.render.InputSourceWindow
Direct Known Subclasses:
CanvasPeerImplAWT, CanvasPeerImplSwing, CanvasPeerImplSWT

public abstract class CanvasPeerImplBase
extends CanvasPeer

The base for CanvasPeer implementation for the official Java OpenGL Bindings (JOGL)


Field Summary
protected  boolean swapIntervalChanged
           
 
Fields inherited from class org.xith3d.render.CanvasPeer
isGammaChanged, oglInfo
 
Constructor Summary
CanvasPeerImplBase(DisplayMode displayMode, DisplayMode.FullscreenMode fullscreen, boolean vsync, FSAA fsaa, int depthBufferSize)
           
 
Method Summary
 void addDestroyableObject(SceneGraphOpenGLReference ref)
          
protected  void beforeRenderStart(PickRequest pickRequest, boolean forceNoSwap)
           
 void clear()
          Clears the screen to BLACK.
protected  org.xith3d.render.jsr231.RenderPeerImpl createRenderPeer()
           
protected  java.lang.Object doRender(View view, java.util.List<RenderPass> renderPasses, boolean layeredMode, long frameId, long nanoTime, long nanoStep, PickRequest pickRequest)
          Uses the current render frame to draw all the graphics for the frame.
 org.openmali.types.twodee.Rect2i getCurrentViewport()
           
protected  java.lang.Class<?> getExpectedNativeDisplayModeClass()
           
abstract  javax.media.opengl.GL getGL()
           
 org.openmali.types.twodee.Rect2i getMaxViewport()
          
 long getRenderedFrames()
          
 org.xith3d.render.jsr231.RenderPeerImpl getRenderPeer()
          
 int getSwapInterval()
           
protected  void init()
           
protected  boolean isInitialized()
           
protected abstract  void setAutoSwapBufferMode(boolean mode)
           
 void setSwapInterval(int swapInterval)
          Updates the swapInterval (used to enable/disable vsync).
 void updateViewport(javax.media.opengl.GL gl, org.openmali.types.twodee.Rect2i viewport)
           
 
Methods inherited from class org.xith3d.render.CanvasPeer
addTriangles, addWindowClosingListener, beforeThreadChanged, destroy, destroyGLNames, fireClosingEvent, getBPP, getBrightness, getCanvas3D, getCanvasID, getComponent, getContrast, getCursor, getDepthBufferSize, getDisplayMode, getFrequency, getFSAA, getFullscreenSwitchRequest, getGamma, getHeight, getInputDeviceFactory, getLeft, getMaxTextureSize, getMaxTextureUnits, getMaxVertexAttributes, getOpenGLCapabilities, getOpenGLInfo, getRenderLock, getTitle, getTop, getTriangles, getType, getViewport, getWidth, getWindow, initRenderingImpl, isClosingListenerRegistered, isDestroyed, isFullscreen, isRendering, isUndecorated, isVSyncEnabled, removeWindowClosingListener, resetFullscreenSwitchRequest, setCanvas3D, setCursor, setCursorImpl, setDepthBufferSize, setDisplayMode, setDisplayModeImpl, setDisplayModeRef, setFullscreen, setGamma, setIcon, setLocation, setOpenGLCapabilities, setSize, setTitle, setTriangles, setViewport, setVSyncEnabled, takeScreenshot, takeScreenshot, takeScreenshot
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jagatoo.input.render.InputSourceWindow
getDrawable, getInputDeviceFactory, receivesInputEvents, refreshCursor
 

Field Detail

swapIntervalChanged

protected boolean swapIntervalChanged
Constructor Detail

CanvasPeerImplBase

public CanvasPeerImplBase(DisplayMode displayMode,
                          DisplayMode.FullscreenMode fullscreen,
                          boolean vsync,
                          FSAA fsaa,
                          int depthBufferSize)
Method Detail

createRenderPeer

protected org.xith3d.render.jsr231.RenderPeerImpl createRenderPeer()
Specified by:
createRenderPeer in class CanvasPeer

init

protected final void init()

isInitialized

protected final boolean isInitialized()

getExpectedNativeDisplayModeClass

protected final java.lang.Class<?> getExpectedNativeDisplayModeClass()
Specified by:
getExpectedNativeDisplayModeClass in class CanvasPeer

getGL

public abstract javax.media.opengl.GL getGL()

getRenderPeer

public final org.xith3d.render.jsr231.RenderPeerImpl getRenderPeer()

Overrides:
getRenderPeer in class CanvasPeer

getRenderedFrames

public long getRenderedFrames()

Specified by:
getRenderedFrames in class CanvasPeer
Returns:
the number of frames already rendered

setSwapInterval

public final void setSwapInterval(int swapInterval)
Updates the swapInterval (used to enable/disable vsync).

Parameters:
swapInterval - the new swap interval (>=0) or -1 to use platform default.

getSwapInterval

public final int getSwapInterval()
Returns:
the swap interval in use (or -1 if not specified).
See Also:
setSwapInterval(int)

setAutoSwapBufferMode

protected abstract void setAutoSwapBufferMode(boolean mode)

addDestroyableObject

public final void addDestroyableObject(SceneGraphOpenGLReference ref)

Overrides:
addDestroyableObject in class CanvasPeer

beforeRenderStart

protected void beforeRenderStart(PickRequest pickRequest,
                                 boolean forceNoSwap)

getMaxViewport

public org.openmali.types.twodee.Rect2i getMaxViewport()

Specified by:
getMaxViewport in class CanvasPeer
Returns:
the maximum size of the viewport.
The values will be invalid before the first frame is rendered.

getCurrentViewport

public org.openmali.types.twodee.Rect2i getCurrentViewport()

updateViewport

public final void updateViewport(javax.media.opengl.GL gl,
                                 org.openmali.types.twodee.Rect2i viewport)

clear

public void clear()
Clears the screen to BLACK.

Specified by:
clear in class CanvasPeer

doRender

protected final java.lang.Object doRender(View view,
                                          java.util.List<RenderPass> renderPasses,
                                          boolean layeredMode,
                                          long frameId,
                                          long nanoTime,
                                          long nanoStep,
                                          PickRequest pickRequest)
Uses the current render frame to draw all the graphics for the frame. If there is not one defined then nothing wil be drawm.