org.globalse.arena.frag.visual
Class GLWorldPainter

org.globalse.arena.frag.visual.GLWorldPainter

public class GLWorldPainter
implements WorldPainter

Makes now all the drawing of OpenGL objects. This class communicates with the GL4Java Framewwork. It could be changed in the future with an eventListener instad using the specialisiation of the framework.


Constructor Summary
GLWorldPainter(int w, int h, java.lang.String glClass, java.lang.String gluClass)
          Creates a new GLWorldpainterObject
 
Method Summary
 void animationCalc()
          is a method for animation of specific GL-objects
 void display()
          draws all the opengl objects
 void drawAllObjects()
          takes the object list from the drawManager and draws it on its GL context
 void drawSpecificObject(java.lang.String obj, float x, float y, float z)
          draws a specific object.
 void init()
          Initalisation of the GL context and other setup things for OpenGL
 float MyRand()
          returns a random number
 void preInit()
          you can make some preSetup for OpenGL
 void ReInit()
          isn't used here.
 void reshape(int width, int height)
          makes an art of readraw
 void setDrawManager(DrawManager drawManager)
          The DrawManager has to be handed to the WorldPainter, in order for the WorldPainter to work.
 void setObjectManager(ObjectManager objMan)
          sets the objectmanager
 

Constructor Detail

GLWorldPainter

public GLWorldPainter(int w,
                      int h,
                      java.lang.String glClass,
                      java.lang.String gluClass)
Creates a new GLWorldpainterObject
Parameters:
w - int with of the painting area
h - int high of the painting area
glClass - isn't in use for now
gluClass - isn't in use for now
Method Detail

preInit

public void preInit()
you can make some preSetup for OpenGL

setDrawManager

public void setDrawManager(DrawManager drawManager)
The DrawManager has to be handed to the WorldPainter, in order for the WorldPainter to work.
Specified by:
setDrawManager in interface WorldPainter
Parameters:
drawManager - The drawManager which is responsible for the GLWorldpainter
See Also:
<{DrawManager}>

init

public void init()
Initalisation of the GL context and other setup things for OpenGL

reshape

public void reshape(int width,
                    int height)
makes an art of readraw
Parameters:
width - width of the redraw area
height - height of the redraw area

display

public void display()
draws all the opengl objects

animationCalc

public void animationCalc()
is a method for animation of specific GL-objects

ReInit

public void ReInit()
isn't used here. See the javadoc for GL4Java

MyRand

public float MyRand()
returns a random number
Returns:
float generated random number

drawSpecificObject

public void drawSpecificObject(java.lang.String obj,
                               float x,
                               float y,
                               float z)
draws a specific object. the call comes from the drawmanager.
Parameters:
obj - String object name which is drawn
x - int x position where the object on the screen is drawn.
y - int y position where the object on the screen is drawn.
z - int z position where the object on the screen is drawn.

drawAllObjects

public void drawAllObjects()
takes the object list from the drawManager and draws it on its GL context

setObjectManager

public void setObjectManager(ObjectManager objMan)
sets the objectmanager
Specified by:
setObjectManager in interface WorldPainter
Parameters:
objMan - an objectmanager



This page is hosted by the Chair for Applied Software Engineering of the Technische Universität München.
Imprint (Impressum)