I have always coded in pure java and have only begun to use librarys due to javas inability to use the GPU. I am considering writing scripts in cuda then running them through C++ or programming in C++ entirely because of the fact java does not like hardware.
Java2D/Graphics2D’s rendering pipeline supports hardware acceleration by the GPU, though not on all operating systems.
- Jev
I started on my first game with just pure java. Then I needed audio, got a simple library for that. Next I needed TMX maps, got another little library for that.
Then I realized libGDX has everything I needed. I spend about 2 months struggling to implement my game in pure java, then I just redid it all in about a week with libGDX. Way easier!
Soon, I will be enlightened and then use LibGDX for everything.
… Soon.
- Jev
It is glorious. Once you attain enlightenment, you never look back but to scorn the old ways, disbelieving that you ever found truth in them.
“What do you believe in?” “LibGDX.”
Circle-jerking and off-topicness aside, I beg the question(s): if you use a library written solely in Java, is that not still pure Java? Where does the standard library (read: LIBRARY) come in to this? Is it still pure if you yourself never touch the natives? Or is the syntax of a C wrapper to ‘unclean?’ What exactly does this ‘pure java’ buzzword even mean?
Well… I assume you aren’t serious about that… but:
Pure Java meaning just the libraries that come with Java when you download it. No libraries that someone else besides the Java developers has developed. Realistically it’s a silly idea, but it can be done. The quality of the game in this case would depend heavily upon the developer though, as they will need to know much about how Java2D works to fully utilize it’s “power”.
I do sort of agree with you though. Libraries are libraries, they help you out when you don’t have the will or time or the knowledge to develop your own solution. I know, and hate the feeling sometimes, of not using all but my own code. I feel almost as if I’m a bad programmer because I couldn’t have thought of that on my own. Especially if it was a simple solution. I think as programmers, many of us have big egos when it comes to problem solving, me included. I want to be the sole creator of my game (in terms of code, other people can help but they cannot use libraries either! ) because then I know I solved all the problems. It’s a silly way to think, and very unproductive, but I’ve been forcing myself out of this mindset slowly. It burns!
That is exactly how I work Opiop65, then I also don’t have to spend 15 minutes putting each native through JarSplice to distribute it. I just slap it into a runnable jar file.
That’s not entirely what I meant though. I don’t use Java2D, I use LWJGL, which still requires JarSplice to link natives. I meant other libraries for networking, sound etc… I generally try to write my own code. But, don’t be afraid of JarSplicer or using libraries. I think your issue is your lack of (no offense) experience dealing with libraries. Creating a runnable program with them is a few clicks, its very easy. My issue is that I don’t like using them because I have too much of an ego. That might be your issue too, but until you get over the whole JarSplice thing you shouldn’t discount libraries.
JarSplice is absolutely terrifying to me. (I do have a rather big ego as well :P) When I was making Project Raft (I know don’t laugh :P) I had started off using Slick2D. (Wouldve made the game wayyyy better) Then I couldn’t distribute it for some strange thing with JarSplice (Probably something to do with me) So I restarted. It did the same thing. So I finally said f*** it (After 2 weeks of fooling around with Slick2D) and i just went completely boiler plate. Thats why I am terrified of libraries.
That’s a trivial problem to solve, as is JarSplice. Literally all you do is point the program to the natives, give it the libraries and the jar you generated from Eclipse, and then give JarSplice the main class and boom, done. If you want I can post a tutorial tonight with pictures explaining everything instead of doing my 12 page math packet!
Haha that would be great. As long as you get that packet done. Make sure to link it to this post if you ever get around to it. I personally think it would be quite beneficial to most. (Me trying to seem more educated than the average joe and just ending up sounding British)
I can tell you now that Slick2D is breath takingly easy. I love it! I wonder if it works well with Kryonet.
[quote=“opiop65,post:26,topic:47167”]
Well, it’s not such a “silly idea” anymore since Java 8, which includes the hardware accelerated multi-media library JavaFX. I only started to examine it a few weeks ago in my very limited spare-time, but my tests so far are very satisfying.
The Fx library does provide a simple to use but solid all-around API with an accelerated and combined 2D & 3D scene-graph; the 3D part uses an adapted version of Java3D. Since Fx and its scene-graph is for general purposes – UIs, diagrams, etc. but also casual games --, it is for sure not as efficient as a dedicated game engine. But it works well on all platforms and out of the box, and is easy enough to learn and use.
By the way, Fullscreen on and off now takes one to three lines of code and actually works!
Java 8 final will be out in ~mid of this March 2014, and we already have a solid Release Candidate on Java.net. So it can be used already now. It runs on all major platforms, also on ARM Linux powered devices.
I always advice people to use those libraries and tools which fits best for them. I think with Java 8, pure-Java is also possible for casual games, finally. As an old pure-Java fan I really do love that.