I’ve recently decided to learn about OpenGL in an attempt to create a nice looking program for extra credit in my GUI/OOP class. I’ve been going through the tutorials @ http://nehe.gamedev.net/ but there is a problem beginning at Lesson 6. The code given to load a bitmap gives a compile error stating "expected constructor, destructor, or type conversion before ‘*’ token. Below, I’ve listed the line generating the error. Any ideas?
Hi BrandonLP,
I believe AUX_RGBImageRec is a part of glaux library. And, glaux library is now obsolete. So, it is better not to use glaux.
However, if you still want to work with it (at least to compile the Nehe tutorial), search for glaux.h and its library (dll or lib). If you cannot find one, let me know.
66 C:\Documents and Settings\Brandon\Desktop\opengl\lesson26\Lesson26.cpp expected constructor, destructor, or type conversion before ‘*’ token
Here’s the entire block of code:
AUX_RGBImageRec *LoadBMP(char *Filename) // Loads A Bitmap Image
{
FILE *File=NULL; // File Handle
if (!Filename) // Make Sure A Filename Was Given
{
return NULL; // If Not Return NULL
}
File=fopen(Filename,"r"); // Check To See If The File Exists
if (File) // Does The File Exist?
{
fclose(File); // Close The Handle
return auxDIBImageLoad(Filename); // Load The Bitmap And Return A Pointer
}
return NULL; // If Load Failed Return NULL
}
Also, if this method is antequated, I wouldn’t be against learning a new way to do it.
We at NeHe are aware of the problem, the original lesson was written a long time ago, we have since rewritten it totally, it’s now a sweet and lightweight tga loader (even i who wrote it was amazed by it’s sweetness), but it’s yet to be released, so in the meantime we made this temporary fix. glAux fix