APIs: Opengl, with SDL (and SDL_mixer)
Compiler: Borland Comand Line
Problem: The coloring of my textures does not match the bitmap they were created from.
Code: Texture Loading
Screen shot: compariosn of Bitmap, and paddle with texture applied.Code:int loadGLTexture () { printf("starting Load texture\n"); int status = FALSE; SDL_Surface *textureImage[1]; textureImage[0]=SDL_LoadBMP("texture.bmp"); if (textureImage[0]) { printf ("textre Loaded \n"); status = TRUE; glGenTextures(1, &textures[0]); glBindTexture(GL_TEXTURE_2D, textures[0]); glTexImage2D(GL_TEXTURE_2D, 0, 3, textureImage[0]->w, textureImage[0]->h, 0, GL_RGB, GL_UNSIGNED_BYTE, textureImage[0]->pixels); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); } if (textureImage[0]) SDL_FreeSurface(textureImage[0]); printf("done with Load texture"); return status;



LinkBack URL
About LinkBacks


