Removing the MS-DOS Window.

Removing the MS-DOS Window.

Post by Nicholas D. Anderso » Thu, 19 Feb 1998 04:00:00



Hi there.

        Whenever I write an app for Windows NT in OpenGL using GLUT, I get a
viewing window(sometimes ;-) and another MS-DOS window in the
background. Sometimes this MS-DOS window is given priority over the GL
window, and blocks it until I click on the GL Window.

        In a nutshell, can someone tell me how to close that console window
without closing the program.

        Thanks for your time.

        Nick Anderson

 
 
 

Removing the MS-DOS Window.

Post by Karl Martin Syrin » Thu, 19 Feb 1998 04:00:00


This is
FreeConsole( );

Regards
Karl


> Hi there.

>         Whenever I write an app for Windows NT in OpenGL using GLUT, I get a
> viewing window(sometimes ;-) and another MS-DOS window in the
> background. Sometimes this MS-DOS window is given priority over the GL
> window, and blocks it until I click on the GL Window.

>         In a nutshell, can someone tell me how to close that console window
> without closing the program.

>         Thanks for your time.

>         Nick Anderson



 
 
 

Removing the MS-DOS Window.

Post by Bob Webe » Fri, 20 Feb 1998 04:00:00


If your using VC++, this was sent to me and it was right on target!!
Thanks again Mark and JDM!!!


:writes:
:|>
:|> I really love the functionality provided by the GLut library but I
would
to
:|> use it under NT without the dos window spawning the graphics window.
Is
:|> this just the price I have to pay due to it's cross-platform
functionality?
:|>  Or is there a way that I can open just a single main window, amybe
even
:|> fullscreen (no, not for a game :) ) and still use GLut?
:
:Yes.  Instead of compiling your app as a "Console" app,
:compile the app as a normal Windows app.  This requires
:writing a "WinMain" instead of a "main" routine and faking
:an empty argc/argv to pass to glutInit.

you don't need WinMain;  the following (MSVC) compiler flags will do the
trick:

         /SUBSYSTEM:WINDOWS /ENTRY:mainCRTStartup

jdm



> Hi there.

>    Whenever I write an app for Windows NT in OpenGL using GLUT, I get a
> viewing window(sometimes ;-) and another MS-DOS window in the
> background. Sometimes this MS-DOS window is given priority over the GL
> window, and blocks it until I click on the GL Window.

>    In a nutshell, can someone tell me how to close that console window
> without closing the program.

>    Thanks for your time.

>    Nick Anderson