Java-Gaming.org Hi !
Featured games (81)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (119)
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  
  Best built-in graphics renderer  (Read 1100 times)
0 Members and 1 Guest are viewing this topic.
Offline mast3rpyr0

Senior Newbie


Medals: 1



« Posted 2012-02-28 23:07:25 »

I have a game so far that loads a map of 64x64 tiles all across the screen, and you can pan around the map, thats about it. Currently I am using AWT I believe to render my graphics, and only the visible map tiles are rendered(+2 on each side of the screen for smoother scrolling)but it doesn't seem that that's going to cut it, at least the way I'm rendering only the map so far. Panning around the map creates space between the tiles and its just all around too laggy.

So, before I get much further I guess I should figure out a better method of drawing. I would really like to use only built-in classes to do so since I want to learn to create my own engine for future use.
If I am correct, that leaves me with either AWT, Swing, or OpenGL. I would prefer OpenGL for the speed and flexibility, but I really hate how messy it makes code(my game is 2D, so maybe its not as bad as 3D).

So what are some of your guys favorites?
Offline StumpyStrust
« Reply #1 - Posted 2012-02-29 00:02:36 »

Slick is nice from what I have heard. I have used lwjgl and for 2d its not all that messy. Just make textured quads. If you want better performance, you will have to go into vertex-arrays/VBO and if you want even more speed, shaders.

But if all your doing is a small game you will probably not need t 4k fps so textured quads should be ok.

Offline kappa
« League of Dukes »

JGO Kernel


Medals: 78
Projects: 15


★★★★★


« Reply #2 - Posted 2012-02-29 00:07:22 »

I'd also recommend Slick2D too, its API is very similar to Java2D so really easy to move over and it uses OpenGL underneath.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline mast3rpyr0

Senior Newbie


Medals: 1



« Reply #3 - Posted 2012-02-29 00:12:40 »

I just saw the syntax of Slick.. im switching now. Lol Thanks.
Offline ra4king

JGO Kernel


Medals: 350
Projects: 3
Exp: 5 years


I'm the King!


« Reply #4 - Posted 2012-02-29 04:58:43 »

Just to clarify:
Swing is built on AWT: meaning that Swing uses Graphics2D to draw the buttons, list, labels, drop downs, etc....

AWT/Java2D is a very, very high level and powerful API that is excellent for simple games to experiment with its many tools. Its only drawback is its speed, very slow compared to OpenGL.

OpenGL is a relatively low-level API that allows you to directly access the graphics card! This means that you don't get methods that draw circles and images and rectangles. Graphics cards only know how to do 2 things: rendering triangles and texturing them and those two things it is damn good at doing. Your code may look messy but that's because it takes many more lines of code to draw an image to the screen because you first need to upload the image data to a texture, bind the texture, specify the vertices of a quad, and render the quad.

Slick2D eases your life by presenting a Java2D-like API using OpenGL underneath. It handles all that boiler plate code to draw simple images and shapes to make your code neat. However, since it is uses OpenGL immediate mode (part of the old "classic" API that is now all deprecated, you will (and should) learn about this later when you study OpenGL), it is still relatively slower than the full power of OpenGL. And by "relatively slow" I mean at least 50-100x faster than Java2D Smiley

Offline Nyhm

Senior Duke


Medals: 3
Projects: 1


Island Forge


« Reply #5 - Posted 2012-02-29 17:19:26 »

Thanks for that great overview, ra4king. I've been lurking in graphic performance threads, and Slick2D is mentioned a lot, but this explains its place in the world nicely. Since the API is very close to Java2D (which I'm using now), I'm likely going to target Slick2D for my next version or project (presuming I have the opportunity to get to a next version/project).

Is a Slick2D project (including its dependencies) easy to deploy to all major platforms (Win,Mac,Linux)? I ask because I've seen different platform libraries for OpenGL. To answer my own question, the Slick2D info makes it sound fine -- I'm just seeking any expert insight from those who have actually used it.

Island Forge: Create Islands with Stories for Others to Explore!
Free-to-Play with Membership and Upgrade options!
Offline ra4king

JGO Kernel


Medals: 350
Projects: 3
Exp: 5 years


I'm the King!


« Reply #6 - Posted 2012-02-29 18:52:20 »

Slick2D just uses LWJGL, which has native code (dlls for Windows, libXXX.so for Linux, and libXXX.dylib for Mac) that you need to put in the library path.

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.

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

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

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

lcass (34 views)
2014-10-15 16:18:58

TehJavaDev (65 views)
2014-10-14 00:39:48

TehJavaDev (65 views)
2014-10-14 00:35:47

TehJavaDev (54 views)
2014-10-14 00:32:37

BurntPizza (72 views)
2014-10-11 23:24:42

BurntPizza (43 views)
2014-10-11 23:10:45

BurntPizza (84 views)
2014-10-11 22:30:10
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!