-2

I have an obj. file almost completed. im stuck on the final part with a single error.

   //load the filename textures (only BMP, R5G6B5 format)
    unsigned int objloader::loadTexture(const char* filename){


unsigned int num;
glGenTextures(1,&num);
SDL_Surface* img=SDL_LoadBMP(filename);
glBindTexture(GL_TEXTURE_2D,num);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
glTexImage2D(GL_TEXTURE_2D,0,GL_RGB,img->w,img->h,0,GL_RGB,GL_UNSIGNED_SHORT_5_6_5,img->pixels);
glTexEnvi(GL_TEXTURE_2D,GL_TEXTURE_ENV_MODE,GL_MODULATE);   
SDL_FreeSurface(img);
texture.push_back(num);
return num;}




objloader::objloader() {
//at default we set all booleans to false, so we don't use anything
ismaterial=false;
isnormals=false;
istexture=false; }

the error message i have been getting is:

Error 33 error C2065: 'GL_UNSIGNED_SHORT_5_6_5' : undeclared identifier

if anything else is needed please let me know.

genpfault
  • 51,148
  • 11
  • 85
  • 139
Richard Cripps
  • 193
  • 1
  • 11
  • 2
    Do you use any extension loading library? Those macros are only defined in higher versions of opengl and thus not in the standard "GL/gl.h" include. – Nobody moving away from SE Jan 13 '13 at 15:53
  • Yeah, i have put on glu32.lib, glew32.lib and gltools32.lib. ive also referenced them at the top of the page just to double check – Richard Cripps Jan 13 '13 at 15:55
  • 2
    The lib files are of no use when it comes to parsing (you need to include the header). As you mention `glew32.lib` did you `#include ` in the file you presented? – Nobody moving away from SE Jan 13 '13 at 15:57
  • that was the one i was missing! its cleared up the error, and has brought 4 similar ones involving SDL. il assume it will be the same thing. thank you for the help! – Richard Cripps Jan 13 '13 at 16:08

1 Answers1

0

Try including <gl/glext.h>
source: http://www.gamedev.net/topic/523837-rgb565/

Kevin
  • 2,739
  • 33
  • 57