PDA

View Full Version : OpenGL: A Primer (2002) pg 150



wmspringer
05-11-2004, 02:00 PM
I'm trying to load a file (grass.ppm) and then texture map it to the ground, which is defined with GL_QUADS. I've been following the instructions in OpenGL: A Primer to read in the file, but it has the line:

image=malloc(3*sizeof(GLuint)*nm);

which just gives "cannot convert from 'void *' to 'unsigned char *'"

Anybody know what it's supposed to be? I've tried a few code snippets from around the web (including the nehe stuff) but none of it works. (I'm using Visual C++ under Win98)

chowe6685
05-11-2004, 02:18 PM
image=(unsigned char*)malloc(3*sizeof(GLuint)*nm);

dvm
05-12-2004, 06:51 AM
and if you want some further information, search "type casting" to understand what the above answer really means.