SaverBeans API V0.2-beta Release release

org.jdesktop.jdic.screensaver
Class JOGLScreensaver

java.lang.Object
  extended byorg.jdesktop.jdic.screensaver.ScreensaverBase
      extended byorg.jdesktop.jdic.screensaver.JOGLScreensaver
All Implemented Interfaces:
java.util.EventListener, net.java.games.jogl.GLEventListener

public abstract class JOGLScreensaver
extends ScreensaverBase
implements net.java.games.jogl.GLEventListener

Base class for OpenGL (JOGL) screensavers. These screensavers use the JOGL API to render screensavers. Subclasses must provide an implementation of GLEventListener methods and be able to return a GLCapabilities object from which the GLCanvas is created.


Field Summary
 
Fields inherited from class org.jdesktop.jdic.screensaver.ScreensaverBase
context
 
Constructor Summary
JOGLScreensaver()
           
 
Method Summary
 void destroy()
          Cleanly shuts down the OpenGL subsystem.
protected  net.java.games.jogl.GLCapabilities getGLCapabilities()
          The GLCapabilities object from which the GLCanvas is constructed.
 void init()
          Initializes the GLCanvas and attaches it to the screensaver.
 void renderFrame()
          Called by the native layer to render the next frame.
 
Methods inherited from class org.jdesktop.jdic.screensaver.ScreensaverBase
baseDestroy, baseInit, getContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.java.games.jogl.GLEventListener
display, displayChanged, init, reshape
 

Constructor Detail

JOGLScreensaver

public JOGLScreensaver()
Method Detail

renderFrame

public final void renderFrame()
Called by the native layer to render the next frame. This method is largely ignored for JOGL screensavers. All painting happens in display() and is controlled by an Animator.

Overrides:
renderFrame in class ScreensaverBase

init

public final void init()
Initializes the GLCanvas and attaches it to the screensaver. First the subclass is queried for a GLCapabilities object by calling getGLCapabilities(). Next, the GLCanvas is created and attached to the screensaver preview window or fullscreen window. Finally, an Animator() is created to drive the animation and the screensaver is attached as a GLEventListener to the screensaver. Subclasses can perform any initialization in the init(GLDrawable) method.

Overrides:
init in class ScreensaverBase

destroy

public final void destroy()
Cleanly shuts down the OpenGL subsystem.

Overrides:
destroy in class ScreensaverBase

getGLCapabilities

protected net.java.games.jogl.GLCapabilities getGLCapabilities()
The GLCapabilities object from which the GLCanvas is constructed. Subclasses can override this method to specifiy their own customized GLCapabilities object. The default implementation returns a default GLCapabilities instance.

Returns:
The GLCapabilities object from which the GLCanvas is constructed.

SaverBeans API V0.2-beta Release release

For more information and documentation on JDIC, see JDIC website.

That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, working code examples, license terms and bug report information.

Copyright (c) 2004 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.