Converting Lesson 10 from Glaux to GLUT

Started by
5 comments, last by caldiar 18 years, 10 months ago
Hey everyone. Working with lesson 10 (the simple map loading one) from nehe.gamedev.net (go figure lol) I really don't like glaux. Not only do I no longer have the file, I find GLUT easier to work with even though I don't have much experience with it. What I want to do is convert the glaux code in lesson 10 so that the demo uses GLUT. The one thing that has me stuck the most is the texture loading and binding. Should I simply replace the glaux commands with the GLUT equivilant and leave the rest of the code intact or would that cause some issues? Im going to screw around a bit more after this post and Ill post back on this thread if I manage to fix my problem. Any help is greatly appreciated. Thanks for your time =) ~Brandon Haston~
Advertisement
the link in my sig can help.

On another note, does GLUT even have texture loading functions.
Again, I get mixed up.

GLUT is for windows creation and management o.O

Glaux is known to have memory leaks which makes me really not want to use it.

Ok so we have glaux, gl, and glu for lesson 10 if I remember correctly.
The demo is using the Win32 HWD type thingy to set up a window and control it. This makes for tons of lines which can be summarized in something like 8 lines with GLUT.
Glaux needs to be replaced as well. Perhaps I could write a bmp loading function and replace the glaux crap that loads up the bmp with the bmp loading function.

Any alternatives to glaux that you can think of? Id be really interested in hearing about it =) Thanks again for your time!

~Brandon Haston~
well to replace glAux in a cheap and fast way you could download the glAux replacement code on the NeHe front page or folow the link in my sig.

For a more longterm solution you will have to fastforward a couple of lessons to lesson 24 where you will learn how to load tga files (witch by the way are better than bmp files).
writing your own bmp loader is a good thing, not only will it replace the glaux replacement, but it will tech you many things in the art of writing file loaders.

I wouldn't recomend anyone to replace a working windows creation and manager with GLUT(or anything else for that matter) just because it looks easier, only if your doing it from scratch for some reason.
just contain it in one separate file and you will be ok.
Download the nehe basecode and see how it's done.
I would suggest SDL. It can do everything glut can plus load bitmap files (and quite a bit more). If you add SDL_IMG library, you can easily load pretty much any image file with a single function call!
I always see this question, but Lesson 10 already exists for GLUT. It's just listed under GameGlut. just select no, when the message box asks you if you want to use GameGlut and there you go! [smile] If I am mistaken, someone please correct me though. I just downloaded it and it looks like glut to me [wink] Cheers!
Well Ill be damned
However I took a look at lesson 24 of nehe.gamedev.net and started tinkering with the TGA loading. I dunno if it works so great or not though because I get this error:
[linker error] undefined reference to 'LoadTGA(char*)'

oh well Ill figure it out =)

I was thinking about looking into SDL but GLUT just feels.... right to me. Can't explain why Im so attracted to it haha =)

Thanks for the help everyone!

~Brandon Haston~

This topic is closed to new replies.

Advertisement