Original Post
Hi,
So I'm trying to use the new OpenGL stuff and do away with all the old stuff but I'm having trouble structuring my programs and can't find any example programs on the internet that help me.
How do people handle these things? At the moment I have a baseObject class that things inherit from, now I was thinking I would give each object a matrix for its transformations that I can pass to a shader. I then need global access to some sort of camera and perspective matrices so I was thinking I would just have them as global objects even though I have always been told this is not good. I also need to store the vertex batches for all different objects to be able to draw them so I was thinking I would give each object its own vertex batches and store ones that are used a lot like cubes, spheres and rectangles as global objects that I can access anywhere encase I need then.
Basically I am really confused about how to structure my program and still be able to get access to all the things I need from the places in my program. Can someone please tell me how they do it or can someone point me in the direction of an example program please.
Thanks
x
So I'm trying to use the new OpenGL stuff and do away with all the old stuff but I'm having trouble structuring my programs and can't find any example programs on the internet that help me.
How do people handle these things? At the moment I have a baseObject class that things inherit from, now I was thinking I would give each object a matrix for its transformations that I can pass to a shader. I then need global access to some sort of camera and perspective matrices so I was thinking I would just have them as global objects even though I have always been told this is not good. I also need to store the vertex batches for all different objects to be able to draw them so I was thinking I would give each object its own vertex batches and store ones that are used a lot like cubes, spheres and rectangles as global objects that I can access anywhere encase I need then.
Basically I am really confused about how to structure my program and still be able to get access to all the things I need from the places in my program. Can someone please tell me how they do it or can someone point me in the direction of an example program please.
Thanks
x