I am using VC++ 5.0 in Win98 and everytime I execute my OpenGL program with GLUT 2 windows is appearing on the screen: a DOS Application Window and My Aplication window.
How can i make the first one disapear.
I know that there are some compiler directives in VC to do it.
Wait for response.
When you create your project in Visual C++ (under File->New), choose “Win32 Application” instead of “Win32 Console Application”. In your code, write a WinMain() function instead of the standard main() function.
int WINAPI WinMain(HINSTANCE, HINSTANCE, LPTSTR commandLine, int);
I think those are the only changes, but play around with it.
Thanks Bman but there is a small problem, if I use winmain instead of main the source-code will loose portability and that’s the biggest reason to me to use GLUT.
I found in a GLUT FAQ that I can use this compiler flags below:
/SUBSYSTEM:WINDOWS /ENTRY:mainCRTStartup
Does anybody knows how can I use that ?
Great! It works. I’ve not posted to this thread yet, but when I saw that there could be a solution i tried it and it worked.
Here’s the complete setup:
Select “Project” -> “Settings”
Select the “Link” tab
In the bottom of the dialog box there is a text area with the “Project Options”.
Look for the word “subsystem”, after it there should be “console”, replace it with “windows”.
Add the following string to the options: “/entry:mainCRTStartup”.