I want to create an application where a piece of code associated with the SDL
window runs continually, drawing the frame and processing input, whether it is
the top window or not. (Kind of like the way a game or emulator will continue
running in the background, but in this I want it to be part of the same
application.)
I have a console window that I want to still be able to type into and debug the
program with while it runs. I’d like to be able to treat the background process
like a callback that is executed once each new frame.
Does anyone have any advice on how it might be possible to do this?
i’m not sure if i got you right, so i will explain how i made some kind
of debug console. In my case i wanted to have two separate processes, so
that the debug console is not affected if my program crashes. I send the
current stack trace via TCP socket to my debug console. This way you are
also able to send commands or other data to your app.
I found this extremely useful to debug segmentation faults or other
crashes in environments where the debugger is unavailable.
Hope it helps!
Matthias
Roger wrote:> Hi,
I want to create an application where a piece of code associated with the SDL
window runs continually, drawing the frame and processing input, whether it is
the top window or not. (Kind of like the way a game or emulator will continue
running in the background, but in this I want it to be part of the same
application.)
I have a console window that I want to still be able to type into and debug the
program with while it runs. I’d like to be able to treat the background process
like a callback that is executed once each new frame.
Does anyone have any advice on how it might be possible to do this?
For a game I’m writing, I created a simple console emulator that draws
text on screen and allows user input, and I have it running in a
separate thread from the main game. It’s rather simple, and just
requires a single mutex to keep the game from writing to the log at
the same time as it’s being read.On 10/1/07, Roger <roger.levy at gmail.com> wrote:
Hi,
I want to create an application where a piece of code associated with the SDL
window runs continually, drawing the frame and processing input, whether it is
the top window or not. (Kind of like the way a game or emulator will continue
running in the background, but in this I want it to be part of the same
application.)
I have a console window that I want to still be able to type into and debug the
program with while it runs. I’d like to be able to treat the background process
like a callback that is executed once each new frame.
Does anyone have any advice on how it might be possible to do this?
If you want to go with the separate window method, you might want to
consider opening a named pipe, launching the console sub-process, and
communicating over that. I think (though I’m not entirely sure, its been a
while since I worked with Win32 named pipes) that it would require less code
than implementing something over TCP/IP.On 10/1/07, Josh Matthews wrote:
For a game I’m writing, I created a simple console emulator that draws
text on screen and allows user input, and I have it running in a
separate thread from the main game. It’s rather simple, and just
requires a single mutex to keep the game from writing to the log at
the same time as it’s being read.
On 10/1/07, Roger <roger.levy at gmail.com> wrote:
Hi,
I want to create an application where a piece of code associated with
the SDL
window runs continually, drawing the frame and processing input, whether
it is
the top window or not. (Kind of like the way a game or emulator will
continue
running in the background, but in this I want it to be part of the same
application.)
I have a console window that I want to still be able to type into and
debug the
program with while it runs. I’d like to be able to treat the background
process
like a callback that is executed once each new frame.
Does anyone have any advice on how it might be possible to do this?