SDL uses opengl, it just does the work for you to make it simpler!
Here is what I have for loading the bmp, I copied some of it from some thing from a google search, then wrote a custom part for loading tha data.
FILE *bmp=fopen("curses_640x300.bmp","r");
if(!bmp)
{
printf("bad filename.\n");
system("pause");
return 1;
}
BITMAPFILEHEADER header;
if(fread(&header,sizeof(BITMAPFILEHEADER),1,bmp)<1)
{
printf("Error reading.\n");
fclose(bmp);
system("pause");
return 2;
}
int p=sizeof(BITMAPFILEHEADER);
while(p<header.bfOffBits){fgetc(bmp);p++;}
int y=0;
int x,r,c;
while(y<16)
{
r=0;
while(r<12)
{
x=0;
while(x<16)
{
c=0;
while(c<8)
{
fgetc(bmp);
myfont[(y*16+x)*12+r]=myfont[(y*16+x)*12+r]*2+(fgetc(bmp)!=0);
fgetc(bmp);
c++;
}
x++;
}
r++;
}
y++;
}
fclose(bmp);
Also how it's used:
GLubyte myfont[256*12];
int o;
void render()
{
glClear(GL_COLOR_BUFFER_BIT);
glLoadIdentity();
glColor3f(mousex/640.0,0.5,mousey/480.0);
glRasterPos2i(0.1,0.1);
glBitmap(8,12,0,0,0,12,myfont+o);
glBitmap(8,12,0,0,0,12,myfont+o+12);
glBitmap(8,12,0,0,0,12,myfont+o+24);
glBitmap(8,12,0,0,0,12,myfont+o+36);
glBitmap(8,12,0,0,0,12,myfont+o+48);
glBitmap(8,12,0,0,0,12,myfont+o+60);
SwapBuffers(hDC);
}
o is incremented each frame until it would show the last tile where it is set back to 0.