View Full Version : how to make the dos window go away

10-16-2003, 04:24 PM
I know there has to be a way to get rid of the dos window using open gl. Do I have to use a direct x call or is there a way to do it in opengl? It is fine for debuging, but for a finished product it needs to go. Thanks

10-16-2003, 05:14 PM
In MSVC, compile the project as a Win32 app instead of a console app. You will have to define WinMain instead of main.

A Win32 App can have a console but the app starts off without one. A dos app simply has the console window opened at startup.

An alternative is to use FreeConsole() (defined in wincon.h) to close the dos window but there may be a momentary flash of the console window at startup. The Win32 project is the method of choice.

10-16-2003, 07:22 PM
If you're using glut and Visual C++, which you may not be, in which case I look like an ass...

Create a Win32 Application project. Then select project->settings from the main menu, select the "Link" tab from the dialog box, select "Output" from the "Category" combo box, and in the "Entry-point symbol" textbox type "mainCRTStartup".

If you'd rather not create a new project, you can convert an existing console project to Win32 by going to project->settings, select the "Link" tab, and in the "Project options" textbox replace "subsystem:console" with "subsystem:windows". Then add "mainCRTStartup" in the "Entry-point symbol" textbox as before.

Paraphrased from http://www.lighthouse3d.com/opengl/glut/

[This message has been edited by Radish (edited 10-16-2003).]

10-16-2003, 09:14 PM
For mingw console app add -mwindows linker option