PDA

View Full Version : Hiding the COMMAND PROMPT window behind my OpenGL app



Chad W
05-30-2006, 04:03 PM
I am just beginning to play with OpenGL. I have made an application that works well. There is a command prompt looking window that shows up behind my application. I need this window to not be there. How can I get rid of it? The window has the heading of the path of my exe.

Thanks in advance...

NewB

songho
05-31-2006, 10:37 AM
Chad W,
I can imagine you are using MS Windows platform. You have to make it as Windows GUI application, not console. It is a compiler specific setting, and no relation with OpenGL.

Please check your compiler manual, and you will have better chance to get the right answer from compiler specific forums or usergroups.

Chad W
05-31-2006, 11:22 AM
Thank you, however my ignorance continues. I changed the project type from console to just an empty WIN32 and the app crashes before even bringing up the openGL window. it crashes at-

void OGAPIENTRY glutKeyboardFunc(
void( * callback )( unsigned char key, int x, int y )
)
{
if( !ogStructure.Window->IsClientMenu )
SET_CALLBACK( Keyboard );
}

I looked through all the project types under C++, and nothing really jumped out at me. I am using VS2005.

songho
06-01-2006, 09:46 AM
I think you posted the glut source code, and it should not crash at this point.

Please post your code again where you register keyboard callback function and actual implementation of your callback routine.

06-07-2006, 12:55 AM
If your project is a console app using GLUT in Visual Studio, you can add the following line to your source file to prevent the extra console popup


#pragma comment(linker, "/subsystem:\"windows\" /entry:\"mainCRTStartup\"")