"A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects." (Robert A. Heinlein)

Thursday, 2 May 2013

Slick2D on Netbeans (and the EEEPC)


This post is sort of a corollary at my previous post: after trying Slick2D on my desktop computer, and Eclipse, I decided to port the demo projects to Netbeans, on the EEEPC, where I do many of my programming experiments.
The use Slick2D with Netbeans is covered, in the site wiki, as well as the Eclipse case. The first step is creating a Java application project
once the project has been created Slick2D and LWJGL Java libraries must be added to the project class-path. This can be done by selecting one-by-one the needed JAR files but, if you're going to make more than one project setting-up a custom library will be handier.
So I, from the project properties, I selected the libraries folder then the “Add Library ...” button.

Here I selected the “Create ...” button, gave the name “Slick2D” to the new library
and selected the required JAR files
last step is telling the project to use LWJGL native libraries, since Netbeans doesn't have a specific GUI to do this it mus be specified by adding the in the parameter
-Djava.library.path=<native -libraries -path>
in project run configuration
At last here is my bouncing ball demo running on Netbeans too
it runs, on the EEEPC 900, only a littler slower than on my desktop computer (54 fps instead of 60) of course in a more serious, and complex, program things might change considerately.