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