Where to start?

Hello! ;D

I am new to the JGO forums and I’m looking for some guidance. I’ve worked with java for about a year now, and fairly consistently at that(pretty much everyday). I want to start using the Graphics2D library and get into 2D graphics. However, I’m not looking for a library such as Slick2D or libGDX because I want to learn what goes behind it, such as game loops and working with backbuffers and the like. Any help would be greatly appreciated! Sorry in advance if I’m unclear in any way.

Looks like a great community from the few threads I’ve read so far and I’m excited to have joined. ;D

Slick and LibGDX do not use Java2D, because Java2D is slow.
They use LWJGL, which is a Java binding for OpenGL.

So, what you’re saying is you want to use LWJGL?

[quote]Slick and LibGDX do not use Java2D, because Java2D is slow.
They use LWJGL, which is a Java binding for OpenGL.

So, what you’re saying is you want to use LWJGL?
[/quote]
Yep, I know that these libraries run OpenGL “underneath”, but I mean that I would like to start working with 2D graphics, but not so far as to working with libraries like these. Hope I clarified that :). Thanks for your response!

Yes, but do you want 2D graphics with Graphics2D or LWJGL?

LWJGL is more under-the-hood than Graphics2D, and is much better performing. But there are a lack of beginner tutorials that don’t use Slick/LibGDX.

Java2D (Graphics2D) is slower, and easier to learn.

Once you’ve learnt both though, you will find LWJGL is easier to use.

There was a topic made by someone (I forget who, sorry) that suggested that I learn Graphics2D before delving into LWJGL. Do you think I can just jump the gun and go straight into LWJGL?

Also, I’ve seen some of your projects (very cool!). Did these use LWJGL?

All my projects were done with LWJGL, but when I was learning java I used Java2D.

You said you’ve learnt Java for a while, so it’s really up to you whether you use Java2D or LWJGL.
If LWJGL is too hard you can always switch to Java2D anyway.

IMHO it would be better to just jump into LWJGL. Ideally you should start with a somewhat higher level library that at least allows you to skip the boilerplate, and learn the core concepts (texture handling, vertex attributes, shaders, etc). Then it will be much easier to “drop down” into lower-level GL and write your own rendering library.

I have some LWJGL tutorials below. The API itself is very minimal and its source will be a good reference point for building your own tools (i.e. after you are comfortable with the concepts at a higher level).

Thanks for the replies ^^
I guess I will start with LWJGL, but I wanted to learn the logic behind building a game engine first, so I figured Java2D would be easier for this instance. And yes, HeroesGraveDev, if it does end up being too hard, I’ll probably switch, though I doubt it will be too difficult for me.

@davedes - I skimmed through your tutorials, and they seem well organized. I’ll probably learn from these. Thanks a bunch!

Also, is there anywhere where I can learn about coding a game engine? Thanks again.

Uhhh… coding a game engine probably isn’t a good place to start.

The good news about starting LWJGL (does anyone else have to think the title when typing the acronym :stuck_out_tongue: ) is that you can always fall back on Java2D, if the tutorials are difficult to grasp. The ones that davedes wrote up are really good though, some of the best I’ve seen for those topics thus far. Probably a non-issue.

The best way to tackle learning any language framework is to think of something you’d want to do in it, and figuring out how to do it. Usually, people point at games because inwardly it is something a lot of people would like to do. It also makes for a good show-off piece. On the flip side, you’ll end up learning a lot more about the technology you want to use, and come up with a tool set of functions and classes you can use for more complex gadgets.

So, your goal should be to just learn as much as you can. Think about things you want to do in the framework, and use those things to build bigger projects. Pretty soon, you will have a nice set of tools to pull from. At the end, you might not have an engine but, you’ll have a great set of tools that you learned a lot from as well.

I can’t for the life of me figure out why people think Java2D is easier what with all the mucking about with VolatileImage this or BufferedImage that, or god forbid they want to tint an image a particular color or fade it out. Want to move an image around? Oh you’re writing all that by hand too. Stuff gdx gives you as one-liners, and oh yeah it’s literally 30 times faster to boot.

Learn both.

… but learn LWJGL first :wink: There are tutorials all over the place for learning OpenGL.

Cas :slight_smile:

[quote]Uhhh… coding a game engine probably isn’t a good place to start.
[/quote]
Yes, I suppose so, perhaps I misused the term “game engine” here. What I mean is I definitely want to learn game programming, that was kind of my main motivation for learning programming in general. I want to learn the necessary parts to making a game, such as spritesheets, implementing those, rendering, game logic, and the like.

[quote]I can’t for the life of me figure out why people think Java2D is easier what with all the mucking about with VolatileImage this or BufferedImage that, or god forbid they want to tint an image a particular color or fade it out. Want to move an image around? Oh you’re writing all that by hand too. Stuff gdx gives you as one-liners, and oh yeah it’s literally 30 times faster to boot.
[/quote]
I’ve seen some code behind some Java2D based games. I was really not looking forward to typing out so much for so little. XD Nevertheless, I would’ve gone through with it anyways.

But LWJGL it is! Thanks again, everyone for your input!