Class iicm.ge3d.OGLCanvas
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class iicm.ge3d.OGLCanvas

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Canvas
                   |
                   +----iicm.ge3d.OGLCanvas

public class OGLCanvas
extends Canvas
OGLCanvas - window context for GE3D. Copyright (c) 1996,97 IICM. All rights reserved.

Variable Index

 o cheight
 o cwidth
 o mesa_backbuf
 o verbose

Constructor Index

 o OGLCanvas(String)
constructor

Method Index

 o hasContext()
check whether native methods are callable
 o minimumSize()
...
 o mouseEnter(Event, int, int)
react on mouse enter/exit.
 o mouseExit(Event, int, int)
 o paint(Graphics)
create an OpenGL canvas on first painting.
 o preferredSize()
my preferred size ...
 o setContext(boolean)
activate the context before issuing OpenGL commands in paint
 o swapBuffers()
when finished with drawing, swap buffers or flush drawings (for double buffering resp.
 o update(Graphics)
no need to clear background on graphics update (will be done by 3D drawing)

Variables

 o verbose
  protected boolean verbose
 o cwidth
  protected int cwidth
 o cheight
  protected int cheight
 o mesa_backbuf
  protected int mesa_backbuf

Constructors

 o OGLCanvas
  public OGLCanvas(String t)
constructor
Parameters:
t - window title (needed to identify window)

Methods

 o preferredSize
  public Dimension preferredSize()
my preferred size ...
Overrides:
preferredSize in class Component
 o minimumSize
  public Dimension minimumSize()
... and minimum size
Overrides:
minimumSize in class Component
 o update
  public void update(Graphics gc)
no need to clear background on graphics update (will be done by 3D drawing)
Overrides:
update in class Component
 o paint
  public void paint(Graphics goofy)
create an OpenGL canvas on first painting. derived class must also call setContext () before issuing OpenGL commands paint of a derived class will typically look like this: (see also SampleCanvas in ge3dsample package)
super.paint (gc);  // create context on first draw
if (!hasContext () || !setContext ())  // no context
  return;  // should clear background in this case
// now ready to draw with OpenGL commands
// on first draw you should call GE3D.initGE3D ()
swapBuffers ();  // finish drawing
Overrides:
paint in class Canvas
 o mouseEnter
  public boolean mouseEnter(Event e,
                            int x,
                            int y)
react on mouse enter/exit. (e.g. colormap installation) in native code. if derived class overrides this, remember calling super.mouseEnter/Exit.
Overrides:
mouseEnter in class Component
 o mouseExit
  public boolean mouseExit(Event e,
                           int x,
                           int y)
Overrides:
mouseExit in class Component
See Also:
mouseEnter
 o hasContext
  public boolean hasContext()
check whether native methods are callable
 o setContext
  protected boolean setContext(boolean shading)
activate the context before issuing OpenGL commands in paint
Parameters:
shading - flag - should be set to true unless wireframe drawings
Returns:
flag, whether context could be established
 o swapBuffers
  protected void swapBuffers()
when finished with drawing, swap buffers or flush drawings (for double buffering resp. single buffering)

All Packages  Class Hierarchy  This Package  Previous  Next  Index