org.xith3d.render.lwjgl
Class CanvasPeerImplBase

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

public abstract class CanvasPeerImplBase
extends CanvasPeer

The CanvasPeer base implementation for the LightWeight Java Game Library (LWJGL)


Field Summary
protected static java.lang.Boolean DEBUG_GL
           
protected  java.lang.Thread renderingThread
           
protected  boolean vsyncSwitched
           
 
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 abstract  void applyVSync()
           
protected  void beforeRenderStart()
           
 void clear()
          Clears the screen to BLACK.
protected  org.xith3d.render.lwjgl.RenderPeerImpl createRenderPeer()
           
 void destroy()
          Clears the screen (BLACK) and destroys the display.
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()
           
 org.openmali.types.twodee.Rect2i getMaxViewport()
          
 org.lwjgl.opengl.DisplayMode getNativeDisplayMode()
           
 long getRenderedFrames()
          
 org.xith3d.render.lwjgl.RenderPeerImpl getRenderPeer()
          
protected  void init()
           
protected  boolean isInitialized()
           
protected abstract  java.lang.Thread makeCurrent()
           
 void updateViewport(org.openmali.types.twodee.Rect2i viewport)
           
 
Methods inherited from class org.xith3d.render.CanvasPeer
addTriangles, addWindowClosingListener, beforeThreadChanged, 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

DEBUG_GL

protected static java.lang.Boolean DEBUG_GL

renderingThread

protected java.lang.Thread renderingThread

vsyncSwitched

protected boolean vsyncSwitched
Constructor Detail

CanvasPeerImplBase

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

createRenderPeer

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

init

protected void init()
             throws java.lang.Throwable
Throws:
java.lang.Throwable

isInitialized

protected final boolean isInitialized()

getRenderPeer

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

Overrides:
getRenderPeer in class CanvasPeer

getRenderedFrames

public long getRenderedFrames()

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

getExpectedNativeDisplayModeClass

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

getNativeDisplayMode

public final org.lwjgl.opengl.DisplayMode getNativeDisplayMode()

applyVSync

protected abstract void applyVSync()

makeCurrent

protected abstract java.lang.Thread makeCurrent()

addDestroyableObject

public final void addDestroyableObject(SceneGraphOpenGLReference ref)

Overrides:
addDestroyableObject in class CanvasPeer

beforeRenderStart

protected void beforeRenderStart()

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 void updateViewport(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.


destroy

public void destroy()
Clears the screen (BLACK) and destroys the display.

Overrides:
destroy in class CanvasPeer