我有一个obj。文件几乎完成。我只是犯了一个错误就陷入了最后一部分。
//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; }
我得到的错误信息是:
错误33错误C2065:'GL_UNSIGNED_SHORT_5_6_5':未声明的标识符
如果还有其他需要请告诉我。