console app VS win32 app

im a total newb to GL
and wondering which i should use? console application or win32 application when makeing projects in visual c++

console app looks easier, but u get the crappy dos window when you load it up,
win32 will only work on windows right?
what about console apps?

some comments plz on pro’s and con’s of both would be helpfull

I’ve found GLUT (console) to be the easiest way to start. You can get rid of the console window by adding these:

/entry:“mainCRTStartup” /subsystem:windows

under Project->Settings->Link tab->Project Options.

Hi !

There is no big difference between them, a console application creates a console window, and GUI application does not (unless you want it to).

But if the GLUT api is complete enough for you that is a good choice.


hmm, so theres not much of a diffrence?
what about resizing and tabing from full screen apps etc ???

any 1? plz…

Resizing and tabbing from fullscreen apps? Works fine for me…

in console app?

If your gonna use a Win32 app you might need to know some windows programming if you plan on it handling how things are viewed, especially if your using OpenGl!!!

Since you are new at OpenGL, I would recommend using GLUT with a console application. That way, you can use printf or cout (assuming C/C++) for testing and debugging purposes. GLUT is easy to use, although the callback mechanism may seem tricky at first.

Later, it is trival to change your code that uses GLUT into a Win32 application, either by using gtada’s method or replacing the console app’s main() function with a simple WinMain() function:

int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
    int argc = 1;
    glutInit(&argc, &lpCmdLine);

    // remainder of GLUT initialization

    return 0;

Another way to use a Win32 app without having to write a WinMain which handles the cmd line to pass to glutInit is to use the compiler option /entry:mainCRTStartup in project settings->Link
This way you can use a plain old main() function in a win32 app and still use the same code on unix (you dont get your app-handle though, but you dont want that with glut anyway)