SDL Not Displaying

Hi, I’m writing a game that is spread out across header files and
implementation files. Currently it has a menu screen (handled by one header-
implementation pair) and a gameplay mode (handled by another). SDL setup
functions, keyboard event handling functions and the functions to display
things on screen (SDL_BlitSurface, SDL_FillRect, etc.) are located in a base
class, which the menu and gameplay classes inherit from. For some reason, the
SDL initialization and SDL keyboard handling functions work properly, but the
display functions do not. Just a black screen comes up, and nothing draws at
any point during runtime. Absolutely no compiler errors are found, everything
runs, no unexpected shutdowns. In my menu, “Exit” is the last option, and if i
hit the down arrow a bunch of times then press enter, the program does exit, so
other SDL features are working (SDL_GetKeystate and events). It’s just for some
strange reason nothing but this black screen opens. Has anybody ever heard of
anything like this? If anyone’s interested in attempting, i can post my code
too; i realize it’s hard to troubleshoot without the code but i don’t want to
unnecessarily spam up your space either. Any help is greatly appreciated.

SDL_Flip(screen_surface_here);

I also posted on Gamedev for you - I just don’t know which one you’ll get
first :slight_smile:

-Bryan / AfroFire / BrinOn 7/4/07, Benjamin Towal wrote:

Hi, I’m writing a game that is spread out across header files and
implementation files. Currently it has a menu screen (handled by one
header-
implementation pair) and a gameplay mode (handled by another). SDL setup
functions, keyboard event handling functions and the functions to display
things on screen (SDL_BlitSurface, SDL_FillRect, etc.) are located in a
base
class, which the menu and gameplay classes inherit from. For some reason,
the
SDL initialization and SDL keyboard handling functions work properly, but
the
display functions do not. Just a black screen comes up, and nothing draws
at
any point during runtime. Absolutely no compiler errors are found,
everything
runs, no unexpected shutdowns. In my menu, “Exit” is the last option, and
if i
hit the down arrow a bunch of times then press enter, the program does
exit, so
other SDL features are working (SDL_GetKeystate and events). It’s just for
some
strange reason nothing but this black screen opens. Has anybody ever heard
of
anything like this? If anyone’s interested in attempting, i can post my
code
too; i realize it’s hard to troubleshoot without the code but i don’t want
to
unnecessarily spam up your space either. Any help is greatly appreciated.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Benjamin Towal writes:

Resolved. The idiot sitting in this computer’s chair right now forgot to flip
the screen. Sorry to waste your time.

No worries, I’ve made the mistake more then once.

-BryanOn 7/4/07, Benjamin Towal wrote:

Benjamin Towal writes:

Resolved. The idiot sitting in this computer’s chair right now forgot to
flip
the screen. Sorry to waste your time.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org