Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (757)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (844)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Critique my overal plan  (Read 902 times)
0 Members and 1 Guest are viewing this topic.
Offline kendric

Junior Newbie

« Posted 2007-04-17 14:42:44 »

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.
Pages: [1]
  ignore  |  Print  

EgonOlsen (58 views)
2018-06-10 19:43:48

EgonOlsen (40 views)
2018-06-10 19:43:44

EgonOlsen (60 views)
2018-06-10 19:43:20

DesertCoockie (225 views)
2018-05-13 18:23:11

nelsongames (141 views)
2018-04-24 18:15:36

nelsongames (140 views)
2018-04-24 18:14:32

ivj94 (882 views)
2018-03-24 14:47:39

ivj94 (143 views)
2018-03-24 14:46:31

ivj94 (794 views)
2018-03-24 14:43:53

Solater (158 views)
2018-03-17 05:04:08
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!