ForNeVeR / TankDriver

Simple game about tanks.
MIT License
3 stars 2 forks source link

Windows: show console window only in debug mode #18

Closed ForNeVeR closed 8 years ago

ForNeVeR commented 8 years ago

Currently I've enabled the console window in #16 because we want to be able to debug the game started from terminal. In Windows there's no easy way to control whether I want or don't want to enable the console window. The most obvious way is to compile the application for a console subsystem (see TankDriver.App.csproj:9). This have an undesirable effect: the game will now show the console window every time anybody is starting it. And we don't want to scare ordinary gamers with out black console windows. So we'll need a way to disable console in release mode.

We can recompile application for Windows subsystem, but

So, I think that we need to provide a small Windows-specific piece of code that will detect if an application was launched with specific command line arguments and show (or hide?) console based on that.

See something like that SO answer as a reference implementation.