Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (517)
Games in Android Showcase (123)
games submitted by our members
Games in WIP (577)
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 592 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  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

TehJavaDev (38 views)
2014-10-27 03:28:38

TehJavaDev (29 views)
2014-10-27 03:27:51

DarkCart (43 views)
2014-10-26 19:37:11

Luminem (24 views)
2014-10-26 10:17:50

Luminem (29 views)
2014-10-26 10:14:04

theagentd (35 views)
2014-10-25 15:46:29

Longarmx (63 views)
2014-10-17 03:59:02

Norakomi (61 views)
2014-10-16 15:22:06

Norakomi (50 views)
2014-10-16 15:20:20

lcass (46 views)
2014-10-15 16:18:58
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org 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‑gaming.org
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!