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.
Gluax Replacement Code
www.flashbang.se | www.thegeekstate.com | nehe.gamedev.net | glAux fix for lesson 6 | [twitter]thegeekstate[/twitter]
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.
personally i just use nehe's ipicture code. it works great for me.
probably off topic but o well
probably off topic but o well
What ipicture code? where? tell meeeeeeeeeeeeeeeeeeeeeeeeee!
NB: Yes i just looked for it, so don't yell at me.
NB: Yes i just looked for it, so don't yell at me.
nm, i found it. I don't really understand it, but i found it. that r so far down the track it r not funny.
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 ...
[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]
[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]
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.
It would probably be better today to just go for the TGA tutorials and drop this whole glAUX nonsence.
www.flashbang.se | www.thegeekstate.com | nehe.gamedev.net | glAux fix for lesson 6 | [twitter]thegeekstate[/twitter]
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
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...
Member of the NeHe team | PhD Student at Heidelberg Collaboratory for Image Processing | ProCamera Developer
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement