0

I am making a game and I have a console using AllocConsole(). I want to be able to write commands in the console and I dont really know how to get input without pausing the game loop. Do I need to separate in two threads or is there another way?

Qix - MONICA WAS MISTREATED
  • 14,451
  • 16
  • 82
  • 145

1 Answers1

1

You don't need to pause game loop. Just process the commands in the game loop as you do with keyboard, mouse, network, whatever. One thing you're probably afraid about is that I/O may block until sufficient data are available. If this is the case, you can turn on non-blocking I/O on standard input or you can use stuff like select() to check if there are any data.

Zaffy
  • 16,801
  • 8
  • 50
  • 77