Opening GLUT-Windows in Win32 without a console app window possible?

Heya guys!

I’ve been making quite a progress in programming OpenGL (In my opinion, at least… ), but there’s one thing that annoys me: I’m using the Borland Bcc32 command line compiler and therefore every time I run my program, that stupid Console Window pops up. So is there any way to prevent this? I’d still like to use GLUT and not the wgl-implementation, so that should not be an option…
Thanx for any help!

The_V|k|ng

Humm… Do you have everything set to make a 32 bit windows application vs. a console application?

Originally posted by The_V|k|ng:
[b]Heya guys!

I’ve been making quite a progress in programming OpenGL (In my opinion, at least… ), but there’s one thing that annoys me: I’m using the Borland Bcc32 command line compiler and therefore every time I run my program, that stupid Console Window pops up. So is there any way to prevent this? I’d still like to use GLUT and not the wgl-implementation, so that should not be an option…
Thanx for any help!

The_V|k|ng[/b]

I’ll bet if you open a dos window, cd to where your .exe is and type it at the command prompt you won’t get the window.

Whenever you launch a console app (which a glut program is --it has main, not WinMain) from a gui(say explorer) you get a spurious console window.

The thing is, I do not want a console window in any way! And I’d still like to use GLUT in Win98. So how is this supposed to be done? Is it possible at all? If so, what changes have to be made to the “normal” GLUT programs?

The_V|k|ng

I suspect that you are using GLUT examples as a basis for your own applications. These programs were designed to be executed from a console window on any OS. Windows will create a console window for any program that uses a main() function.

If you want to create a GLUT application that does not have a console window then you will need to replace the main() function with a WinMain() function. A console window will not be created if you use the WinMain function. I think that GLUT creates the message loops and registers the windows for you, so you just need to call the GLUT function in a WinMain routine to execute the app.

Not sure if it is the same in Borland as it is in Visual C++ or not, but this is what I do in VC++ at the top of the file with my main() function in it:

#ifdef WIN32
// pragma to remove extra console window under windows
#pragma comment( linker, “/subsystem:"windows" /entry:"mainCRTStartup"” )
#endif

Heya again!

First of all, thanx for your replies!
Unfortunatley they did not affect much… The #pragma has no effect and replacing the main() by a WinMain produces the following linker error:

Turbo Incremental Link 3.0 Copyright © 1997, 1998 Borland International
Error: Unresolved external ‘_main’ referenced from E:\BORLAND\BCC55\LIB\C0X32.OBJ

Not that I have any clue as to what that means… Does any of you? Can anyone help me with this?

The_V|k|ng