|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Abstracts common functionality among the OpenGL components such as GLCanvas and GLJPanel. The GLDrawable/GLEventListener interfaces allow client code to draw using OpenGL without subclassing.
Method Summary | |
void |
addComponentListener(java.awt.event.ComponentListener l)
the components listener's should be implemented also ! since JDK 1.1 |
void |
addFocusListener(java.awt.event.FocusListener l)
|
void |
addGLEventListener(GLEventListener listener)
Add a GLEventListener to this drawable. |
void |
addKeyListener(java.awt.event.KeyListener l)
|
void |
addMouseListener(java.awt.event.MouseListener l)
|
void |
addMouseMotionListener(java.awt.event.MouseMotionListener l)
|
void |
cvsDispose()
You should call this before releasing/dispose this Window ! Also you can overwrite this class, to dispose your own elements, e.g. |
boolean |
cvsIsInit()
This function returns, if everything is init: the GLContext, the and the users init function This value is set in the paint method! |
void |
display()
This is the rendering-method called by e.g.: GLCanvas.display() or by
GLRunnable.run() . |
GLFunc |
getGL()
Gets the GL functions used by this drawable. |
GLContext |
getGLContext()
Used to return the created GLContext |
GLUFunc |
getGLU()
Gets the GLU functions used by this drawable. |
java.awt.Dimension |
getSize()
this function returns the current size of the object |
void |
removeComponentListener(java.awt.event.ComponentListener l)
|
void |
removeFocusListener(java.awt.event.FocusListener l)
|
void |
removeGLEventListener(GLEventListener listener)
Remove a GLEventListener from this drawable. |
void |
removeMouseListener(java.awt.event.MouseListener l)
|
void |
removeMouseMotionListener(java.awt.event.MouseMotionListener l)
|
void |
repaint()
this function can be called to force a repaint Repaints this component. |
Method Detail |
public void addGLEventListener(GLEventListener listener)
public void removeGLEventListener(GLEventListener listener)
public GLFunc getGL()
GLFunc14
.public GLUFunc getGLU()
GLUFunc14
.public GLContext getGLContext()
public void display()
GLCanvas.display()
or by
GLRunnable.run()
.
The default implementation of display() sends
preDisplay, display and postDisplay events to
all GLEventListener
s associated with this
GLDrawable in the above order.
reset timer for frame duration for_all(gl4java.drawable.GLEventListener) SEND preDisplay if( gljMakeCurrent() ) { for_all(gl4java.drawable.GLEventListener) SEND display gljSwap() gljFree() for_all(gl4java.drawable.GLEventListener) SEND postDisplay } stop timer for frame duration
If you use the subclassing model (as opposed to the GLEventListener model), your subclass will redefine this to perform its OpenGL drawing. In this case you MUST encapsulate your OpenGL calls within:
- glj.gljMakeCurrent() YOUR OpenGL commands here ! - glj.gljFree()
GLContext.gljMakeCurrent()
,
GLContext.gljFree()
,
GLContext.gljSwap()
,
GLEventListener.preDisplay(gl4java.drawable.GLDrawable)
,
GLEventListener.display(gl4java.drawable.GLDrawable)
,
GLEventListener.postDisplay(gl4java.drawable.GLDrawable)
public void repaint()
public boolean cvsIsInit()
GLCanvas.paint(java.awt.Graphics)
,
GLCanvas.init()
public void cvsDispose()
GLContext.gljDestroy()
,
GLEventListener.cleanup(gl4java.drawable.GLDrawable)
public java.awt.Dimension getSize()
public void addComponentListener(java.awt.event.ComponentListener l)
public void removeComponentListener(java.awt.event.ComponentListener l)
public void addFocusListener(java.awt.event.FocusListener l)
public void addKeyListener(java.awt.event.KeyListener l)
public void removeFocusListener(java.awt.event.FocusListener l)
public void addMouseListener(java.awt.event.MouseListener l)
public void removeMouseListener(java.awt.event.MouseListener l)
public void addMouseMotionListener(java.awt.event.MouseMotionListener l)
public void removeMouseMotionListener(java.awt.event.MouseMotionListener l)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |