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.
   
  -   cheight cheight
-  
  
-   cwidth cwidth
-  
  
-   mesa_backbuf mesa_backbuf
-  
  
-   verbose verbose
-  
   
  -   OGLCanvas(String) OGLCanvas(String)
-  constructor
   
  -   hasContext() hasContext()
-  check whether native methods are callable
  
-   minimumSize() minimumSize()
-  ...
  
-   mouseEnter(Event, int, int) mouseEnter(Event, int, int)
-  react on mouse enter/exit.
  
-   mouseExit(Event, int, int) mouseExit(Event, int, int)
-  
  
-   paint(Graphics) paint(Graphics)
-  create an OpenGL canvas on first painting.
  
-   preferredSize() preferredSize()
-  my preferred size ...
  
-   setContext(boolean) setContext(boolean)
-  activate the context before issuing OpenGL commands in paint
  
-   swapBuffers() swapBuffers()
-  when finished with drawing, swap buffers or flush drawings
(for double buffering resp.
  
-   update(Graphics) update(Graphics)
-  no need to clear background on graphics update
(will be done by 3D drawing)
   
 verbose
verbose
  protected boolean verbose
 cwidth
cwidth
  protected int cwidth
 cheight
cheight
  protected int cheight
 mesa_backbuf
mesa_backbuf
  protected int mesa_backbuf
   
 OGLCanvas
OGLCanvas
  public OGLCanvas(String t)
  -  constructor
  
    -  Parameters:
    
-  t - window title (needed to identify window)
  
 
   
 preferredSize
preferredSize
  public Dimension preferredSize()
  -  my preferred size ...
  
    -  Overrides:
    
-  preferredSize in class Component
  
 
 minimumSize
minimumSize
  public Dimension minimumSize()
  -  ... and minimum size
  
    -  Overrides:
    
-  minimumSize in class Component
  
 
 update
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
  
 
 paint
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
  
 
 mouseEnter
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
  
 
 mouseExit
mouseExit
  public boolean mouseExit(Event e,
                           int x,
                           int y)
  
    -  Overrides:
    
-  mouseExit in class Component
    
-  See Also:
    
-  mouseEnter
  
 hasContext
hasContext
  public boolean hasContext()
  -  check whether native methods are callable
 setContext
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
  
 
 swapBuffers
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