com.sun.opengl.impl

Class GLDrawableHelper


public class GLDrawableHelper
extends Object

Encapsulates the implementation of most of the GLAutoDrawable's methods to be able to share it between GLCanvas and GLJPanel.

Constructor Summary

GLDrawableHelper()

Method Summary

void
addGLEventListener(GLEventListener listener)
void
display(GLAutoDrawable drawable)
boolean
getAutoSwapBufferMode()
void
init(GLAutoDrawable drawable)
void
invokeGL(GLDrawable drawable, GLContext context, Runnable runnable, Runnable initAction)
Principal helper method which runs a Runnable with the context made current.
void
removeGLEventListener(GLEventListener listener)
void
reshape(GLAutoDrawable drawable, int x, int y, int width, int height)
void
setAutoSwapBufferMode(boolean onOrOff)

Constructor Details

GLDrawableHelper

public GLDrawableHelper()

Method Details

addGLEventListener

public void addGLEventListener(GLEventListener listener)

display

public void display(GLAutoDrawable drawable)

getAutoSwapBufferMode

public boolean getAutoSwapBufferMode()

init

public void init(GLAutoDrawable drawable)

invokeGL

public void invokeGL(GLDrawable drawable,
                     GLContext context,
                     Runnable runnable,
                     Runnable initAction)
Principal helper method which runs a Runnable with the context made current. This could have been made part of GLContext, but a desired goal is to be able to implement the GLCanvas in terms of the GLContext's public APIs, and putting it into a separate class helps ensure that we don't inadvertently use private methods of the GLContext or its implementing classes.

removeGLEventListener

public void removeGLEventListener(GLEventListener listener)

reshape

public void reshape(GLAutoDrawable drawable,
                    int x,
                    int y,
                    int width,
                    int height)

setAutoSwapBufferMode

public void setAutoSwapBufferMode(boolean onOrOff)

Copyright 2005 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.