Jump to content
  • Advertisement
Sign in to follow this  
Mooncabbage

Gluax Replacement Code

This topic is 2511 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Strange, when i did it it worked fine, no bugs no warnings, no nothing.

maybe you need step by step instructions.

1. take the bmp.cpp and bmp.h files and copy them to the same directory as lesson7.cpp(in your case it's probobly OpenGL7.cpp instead of lesson7.cpp).

2. open up the project in vc++ 6.0 (other versions should work to)

3. under file view find the "source files" folder, right click on it an select add files to folder, choose "bmp.cpp".

4. do the same for the "header files" folder but choose "bmp.h".

5. in "lesson7.cpp" change the folowing line
#include <gl/glaux.h> // Header File For The Glaux Library
to
#include "bmp.h" // Header File For The Glaux replacement Library

6. compile, run and be happy.

Share this post


Link to post
Share on other sites
Advertisement
I use dev cpp, but that shouldn't be a problem, i probably forgot to tell the compiler to link it properly or something... However i didn't even touch the .cpp... figured it was an example file, doh ><. Thanks for the help, i'll try and figure out the source file bit in dev cpp, i think i've seen it somewhere before, however, i'm fairly new to actual c++, so things like source files and having to link included things as well as include them are new and strange to me.

Share this post


Link to post
Share on other sites
There is a little error in the bmp.h of yours. You need to add the line AUX_RGBImageRec *auxDIBImageLoad(const char *FileName); The function is only defined in the .cpp. That's probably why it didn't work for Mooncabbage :) Well it works for me now. Thank you! Now on to limit that hyperfast framerate a bit O_o ...

Share this post


Link to post
Share on other sites
[font="helvetica, arial, verdana, tahoma, sans-serif"][color="#5a5a5a"]@[/font]lc_overlord[font="helvetica, arial, verdana, tahoma, sans-serif"][color="#5a5a5a"] Run-time error when deallocating the [font=courier new,courier,monospace]data[/font] pointer[/font]

[color=#5A5A5A][font=helvetica, arial, verdana, tahoma, sans-serif]I have tested your AUX_RGBImage class and for the most part it works until when the program reaches the point of deallocating the byte [font=courier new,courier,monospace]data[/font] variable through either the destructor or when [font=courier new,courier,monospace]data!=NULL[/font]. I have been trying to solve the problem ever since but it keeps crashing when i reach that point and the only conclusion is can come to is that i overlooked something concerning classes and dynamic allocation or the microsoft visual 2010 compiler is not working cause i even realize that from the code you allocated an byte array so to actually deallocate it wold be [font=courier new,courier,monospace]delete[] data,[/font] but thats not working either. I may be wrong in hypothesis and thats the reason for me making this request for your help.[/font]

Share this post


Link to post
Share on other sites
This pice of code is pretty ancient and im unsure if it even works with the latest Visual studio or how easy it is to fix it as i havn't run this code in a few years, i know it works for MSVC++ 6.0 but that version didn't even have namespace implemented.

It would probably be better today to just go for the TGA tutorials and drop this whole glAUX nonsence.

Share this post


Link to post
Share on other sites
Well thanks for the advice ill try and give it another shot although the last tutorial i did on bitmap was a total garbage and it seemed as if the writer got fed up at the end and just pasted the rest of the code which was in fact incomplete and had me stuck for a couple hours trying to figure out his gibberish. But i got fed up and just download an incredible library named free freeImage that works but i dont feel satisfied knowing that it wasnt me who wrote the code. So ill give it a next shot

Share this post


Link to post
Share on other sites
I added an explanation on how to load textures with SOIL a while ago. I strongly recommend using this easy and reliable method to load your textures instead of GLAUX or any replacement code...

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!