[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: SDL vs stdin?

On Monday 10 May 2004 22:53, Dmitry Samoyloff wrote:
> Hi all,
> I want to implement the console commands in my game engine (to reload
> scripts or maps on the fly, etc) and I'd like to use stdin for this purpose
> to simplify the coding. So, I'm trying to read from stdin using fgets()
> call (or the 'cin' object) in the program that uses libSDL's event handling
> also and this always leads to a crash. Is it a known conflict? Or maybe the
> problem is not libSDL?
> Regards, Dmitry Samoyloff


Are you using SDL on a X display or on a text/framebuffer console? In the 
latter case SDL's keyboard handling might well interfere with standard 
stdin/stdout. In the former case the problem is more likely within your own 
code. But I haven't tried either myself yet, so I can't tell you for sure. 
Maybe you should try to get a stack backtrace to pinpoint the location of the