Hello.
I'm coding an application with openGL using SDL on Linux. I followed the Nehe tutorial and arrived in the texture section. Here, he uses this :
Code :if (TextureImage[0]=LoadBMP("Data/NeHe.bmp")) { Status=TRUE; glGenTextures(1, &texture[0]); glBindTexture(GL_TEXTURE_2D, texture[0]); glTexImage2D(GL_TEXTURE_2D, 0, 3, TextureImage[0]->sizeX, TextureImage[0]->sizeY, 0, GL_RGB, GL_UNSIGNED_BYTE, TextureImage[0]->data); etc. }
where TextureImage is AUX_RGBImageRec *TextureImage[1];
But I can't use GLaux and I don't want to. I've tried to use an SDL_surface instead of AUX_RGBImageRec and use TextureImage->pixels instead of TextureImage[0]->data but it didn't work (I've got a blue square and not a texture).
Can someone explain to me how I can load a texture using SDL ?



Reply With Quote