|
From: Max G. <gi...@li...> - 2000-01-27 22:35:36
|
Hi!
In my application I need variables gl and glu in GLCanvas public instead
of protected. It is needed for remote rendering possibilities - for
example:
//class in package opengl
public class GLViewport extends GLCanvas
{
private ClassThatDrawsObjects ctdo;
public void display()
{
//setup
ctdo.drawMyself(this);
}
}
//class in package geometry
public class ClassThatDrawsObjects
extends SomeOtherNeededClass
{
public void drawMyself(GLViewport viewport)
{
viewport.gl.glBegin(viewport.GL_TRIANGLES);
viewport.gl.glVertex*(...);
...
viewport.gl.glEnd();
}
}
so when program reaches display() method it calls method drawMyself() in
some other class and this class performs rendering (it needs GLFunc to
do so). Have I made myself clear? :-)
Is there any better way to do so? I need this because in my modeler I
want each object to draw itself.
Comments? Sven, how do you think?
Max
|