[SDL] excluding keyboard events from event queue

Eike Umlauf e9726056 at stud3.tuwien.ac.at
Wed Feb 11 21:13:41 PST 2004


hi all

i'm writing an application that displays some openGL stuff in an SDL 
window, but still takes commands with gets() from the win32 console 
(stdin). the openGL graphics need redrawing rather seldom, i.e. only 
when a command is typed on the console. there is a problem about this:

if i draw to the window only once in a while, it will go into "program 
doesn't respond" state and clear itself which is rather ugly. i can 
'wake it up' again by polling all SDL events before doing a redraw but a 
few seconds after redrawing it will go blank again.

so i should probably have the SDL event loop running all the time i 
suppose. but then how can i read from stdinput? fgets() blocks until 
something is entered, and the SDL event loop steals the console's 
keyboard events.

i really can't think of a way to resolve this problems except switching 
to the win32 API (shudder).

thx for any help
eik





More information about the SDL mailing list