|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.proteinshader.graphics.displaylists.GeometricListInfo
public abstract class GeometricListInfo
The concrete subclasses of this abstract class are used to store
information on an OpenGL display list that hold the commands to draw
a geometric object. A GeometricListInfo object is only for storing
information on an OpenGL display list. The code to actually create an
OpenGL display list in graphics card memory is in Shape subclasses
such as Sphere or Cylinder.
An OpenGL display list is a set of OpenGL commands (and the numbers
plugged into them) that is saved in memory on the graphics card. If
many copies of the same object are used in a scene, the use of a
display list can result in dramatically faster rendering.
A valid name (an integer) for a list is obtained by calling
glGenLists(), and then asking the graphics card to remember all OpenGL
commands issued between glNewList() and glEndList(). The following
is an example of how a display list is created:
int displayListName = gl.glGenLists( 1 );
gl.glNewList( displayListName, GL.GL_COMPILE );
sphere.draw( gl, radius, slices, stacks );
gl.glEndList();
The display list can be executed later using glCallList():
gl.glPushMatrix();
gl.glScaled( scale, scale, scale );
gl.glCallList( displayListName );
gl.glPopMatrix();
If a display list is no longer needed, its memory can be freed up using:
gl.glDeleteLists( displayListName, 1 )
Constructor Summary | |
---|---|
GeometricListInfo()
Constructs a GeometricListInfo. |
|
GeometricListInfo(int displayListName,
StyleEnum style)
Constructs a GeometricListInfo. |
Method Summary | |
---|---|
int |
getDisplayListName()
Returns the name of the OpenGL display list that this GeometricListInfo object stores information on. |
StyleEnum |
getStyle()
Returns the style that the geometric object is intended for: SPACE_FILLING, BALLS_AND_STICKS, or STICKS. |
void |
setDisplayListName(int displayListName)
Sets the name of the OpenGL display list that this GeometricListInfo object stores information on. |
void |
setStyle(StyleEnum style)
Sets the style that this geometric object is intended for: SPACE_FILLING, BALLS_AND_STICKS, or STICKS. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GeometricListInfo()
public GeometricListInfo(int displayListName, StyleEnum style)
displayListName
- the name (an integer) of an OpenGL display list.style
- the style as a StyleEnum.Method Detail |
---|
public int getDisplayListName()
public void setDisplayListName(int displayListName)
displayListName
- the name (an integer) of the OpenGL display list.public StyleEnum getStyle()
public void setStyle(StyleEnum style)
style
- the style as a StyleEnum.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |