I'm very new to OpenGL/LWJGL. I'm reading a lot of VBOs.
I'm sorry if I can't concretise my concern, but i'll try it:
Why should I use VBOs? Whats the difference between using VBOs and glBegin() and glEnd()?
My Game is organized like this:
- One huge map
- some static objects like trees on this map
- Enemies and Characters
Enemies and Characters are spawned on the fly
and my gameLoop is like this: statemanager.render()=>Map.render()
Where Map has an Enemy[] and Character[], where both of them have a Tree of Meshes and Mesh has the Vertex-Arrays.
public class Tree<T>
{
T data;
T child;
}
abstract class MoveableObject
{
Tree<Mesh> meshTree;
public Vector3f pos;
public Vector3f rot;
}
public class Mesh
{
Vector3f[] vertices;
Vector3f[] colors;
Vector3f[] normals;
}
Where and how should I setup the VBOs? For example A map and the statics never change, can I setup a VBO once for them instead of setting it up every frame?
Most OpenGL Tutorials show prototypes of the methods, but never explain the parameters of these methods. It's hard to understand how they actually work, if you've never worked with it before. (Yes, I alread did that Triangle/Cube Tutorial)