I'm trying to load bitmaps into OpenGL textures. Partially following NeHe's tutorials, but since everyone hates GLAUX, I'm trying to find replacement. Currently both NeHe's glaux replacement and other bmp load replacements I googled give a compillation error that I think has something to do with '&' operator and types.
Here is the line that gives the error:
[code]int LoadBitmap(LPTSTR szFileName, GLuint &texid, int width, int height)
{
alot of code here
return 1;
}[/code]
Here is the error:
[code]syntax error before '&' token[/code]
I've only seen a few less descriptive errors... Could anyone tell me what could be the problem?
Also, it would be neat if there was some sort of online C debugger, where you paste your code like into a translator, and it tells you in plain English what's wrong there... Not sure if there is one.
First off, GLuint is a type declared in <GL/gl.h> Make sure you #include it. Also, you need to make sure that you are compiling this as C++, since C does not have support for the reference type arguments. (it requires all arguments be literals, and this means expressions and pointers)
If you wanted to compile this as C, you need to make the syntactical changes to make "GLuint &texid" to "GLuint *texid." It is a non-const pointer. This is easy enough.
[editline]11:19AM[/editline]
Also, I use the [url=http://cimg.sourceforge.net/]cimg library[/url] to do all of my image loading because it seamlessly supports all sorts of different formats. Perhaps I should look for something more streamlined since it also does a lot of processing shit that I don't need.
Sorry, you need to Log In to post a reply to this thread.