Hi guys,
I’m a newbie and I’m trying to Display a bitmap…
basically, my program calls an InitGame function from Main and then
enters a while loop (infinite right now…)
In the InitGame function, it sets up the display and opens the window
and then calls the ShowBMP function which was taken directly from the
samples on the SDL site…
Here is my InitGame code:
int InitGame(void)
{
if((SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO)) < 0)
{
fprintf(stderr, “SDL error: %s\n”, SDL_GetError());
return 0;
}
screen = SDL_SetVideoMode(640, 480, 16, SDL_HWSURFACE);
if(screen == NULL)
{
fprintf(stderr, “Video error: %s\n”, SDL_GetError());
exit(1);
}
SDL_WM_SetCaption(title_string, NULL);
ShowBMP("…/Images/station1.bmp", screen, 1, 1);
}
As I mentioned, ShowBMP is the sample code…
http://www.libsdl.org/intro/usingvideo.html
The problem is simple that all I get is a black box for a window… no
bitmap…
Any ideas what I missed? I am a fairly good OpenGL programmer via Xlib
but just getting started with SDL. (and I have years of C/C++
experience that seems to be useless now…)
Daniel