Archived

This topic is now archived and is closed to further replies.

Mithoric

Loading bitmaps with SDL

Recommended Posts

I''m trying to load a bitmap with SDL for an OpenGL texture.
SDL_Surface *bitmap = SDL_LoadBMP(fileName);
    glGenTextures(1,&tex->texID);
    glBindTexture(GL_TEXTURE_2D,tex->texID);
    glTexImage2D(GL_TEXTURE_2D,0,3,bitmap->w,bitmap->h,0,GL_RGB,GL_UNSIGNED_BYTE,bitmap->pixels);
    SDL_FreeSurface( bitmap );
The afore doesn''t seem to be working for me though.

Share this post


Link to post
Share on other sites