Nehe Tutorials - questions and comments..

Started by PlanetMongo, November 17, 2003, 16:19:59

Previous topic - Next topic

PlanetMongo

I've been working a tiny bit on the Nehe tutorials using lwjgl and just had a question (or more):

One of the things I've noticed with the nehe ports that just stands out is this:
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.geom.AffineTransform;
import java.awt.image.AffineTransformOp;
import java.awt.image.BufferedImage;
(from Nehe08).

Now, I thought that to be a bit odd in that I thought one of the goals of lwjgl was to get away from AWT/SWING as much as possible..

Then, I stumbled across this gem:
Image image = (new javax.swing.ImageIcon(path)).getImage();

Ack!  SWING!  

Now, I'm sure that using these are most convenient for the purposes of teaching OGL using LWJGL and Java at it's most basic, but wouldn't it be a bit more, I dunno, prudent to show how to do this using strictly LWJGL (maybe through Spaghetti, though?)?  

I'm not by any means criticizing the ports, indeed I'm much thankful for them.  I'm just thinking that it might be time to rework the ports for more "LWJGL" compliance for us newbie coders (I suppose the best idea would be for us to do it ourselves, that way we learn it better?  I've actually had time to play with it a bit more lately, but I find myself stuck in a Native Instruments keyboard interface, cranking out really bad 70's sci-fi sound effects/music... ;)  ), that way we can see how LWJGL can be used to create sprites, load images, and what not.  

Just a thought.
ife sucks, kill yourself.

Matzon

I 100% completely agree with you, however someone has to do the job :)

Problem is, that if you use non AWT/SWING stuff, people have to download that too - spaghetti comes to mind. And spaghetti is just too big a mouthfull for someone just wanting to test LWJGL. Therefore using simple awt/swing is much easier, and doesn't divert the users attention from the actual LWJGL code.

Using Spaghetti or other 3rd party libraries for simple example, really doesn't seem like the best solution. Suggestions are accepted though :)

cfmdobbie

Well, Spaghetti's just a GUI library (although it was probably intended to do much, much more in recent months...).  The AWT/Swing you mention above appears to be for loading of image data - a boring task that doesn't make for an exciting tutorial.

If you're releasing a Java/LWJGL game, you're likely to use your own image loader (and maybe even your own image format), but in a tutorial it's very useful for the user to be able to quickly swap in their own textures, if only to see that they've had an effect on the program - very good for the soul, that.

But of course you're right - people shouldn't have to start digging into AWT/Swing to learn LWJGL.
ellomynameis Charlie Dobbie.