I am very new to Opengl in general. I have been converting my client\server game from java2d to opengl this week and I have some questions.
First off I want to see if my overal design will port well. Ihave ported all the code, but perhaps how I am doing it is a horrible way to do opengl.
Basically the code works like this in java2d, and I have tried to port it exactly
Iterate through x render layers
Layer 1 renders the background by drawing 4 copies of a large png, each shifted to provide a scrolling background as they move in any direction(2d)
Layer 2 translates the origin such that it is centered on the player’s object in the game, then it iterates through all the objects in the game getting their renderer and asking it to draw them. For most objects this consists of the objects image being drawn at their x,y co-ordinate with possibly some images on top of them as decoraters
Layer 3 draws some top level things if applicable, like showing a score screen if a certain key is held down
Finally no the very top i draw some more strings for debug info like FPS etc.
How i ported this over was basically verbatim. I imagine i should just draw everything in its actual location and then just shift the camera to center on the player, or find a way to shift the whole thing negatively to center the player.
Anyhow is this approach a good way to do things? It will involve a lot of opengl calls seperate from each other which may or may not be bad, and I started some wrapper funcions like drawText(int x,int y, String str).
I have many issues with the rendering so far but before I get into those I want to make sure my approach is even a good one.