Hi !
Featured games (85)
games approved by the League of Dukes
Games in Showcase (623)
Games in Android Showcase (176)
games submitted by our members
Games in WIP (676)
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 1364 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.

Online kappa
« League of Dukes »

JGO Kernel

Medals: 96
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.
Online ra4king

JGO Kernel

Medals: 404
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 Devvie

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!
Online ra4king

JGO Kernel

Medals: 404
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, 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.

BurntPizza (8 views)
2015-10-07 02:11:23

KaiHH (12 views)
2015-10-06 20:22:20

KaiHH (11 views)
2015-10-06 19:41:59

BurntPizza (23 views)
2015-10-06 19:04:48

basil_ (44 views)
2015-09-30 17:04:40

shadowstryker (22 views)
2015-09-29 15:55:06

TheSpaceHedgehog (28 views)
2015-09-29 01:58:48

GamerC4 (54 views)
2015-09-24 21:10:38

GamerC4 (71 views)
2015-09-24 21:09:48

htuy (28 views)
2015-09-24 04:57:24
Math: Inequality properties
by Roquen
2015-10-01 13:30:46

Math: Inequality properties
by Roquen
2015-09-30 16:06:05

HotSpot Options
by Roquen
2015-08-29 11:33:11

Rendering resources
by Roquen
2015-08-17 12:42:29

Rendering resources
by Roquen
2015-08-17 09:36:56

Rendering resources
by Roquen
2015-08-13 07:40:51

Networking Resources
by Roquen
2015-08-13 07:40:43

List of Learning Resources
by gouessej
2015-07-09 11:29:36 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!