Console window

  1. How do not show console window in Visual C++ console applications ? Every running this window appears with message “Press any key to continue”.

  2. Do not work glGetString function. glGetString(GL_VERSION) gives 0.

Thanks in advance, Aleksei.

Originally posted by KAE:
[b]1. How do not show console window in Visual C++ console applications ? Every running this window appears with message “Press any key to continue”.

  1. Do not work glGetString function. glGetString(GL_VERSION) gives 0.

Thanks in advance, Aleksei.[/b]

  1. Don’t make a console application, make a Win32 Project (not Win32 Console Project). Look at nehe.gamedev.net for basic example code if you need more help with that.

  2. glGetString returns a GLubyte, according to the documentation (I read the MS ones at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/opengl/glfunc02_6dwn.asp)) if glString returns 0 there’s an error. If the error is GL_INVALID_ENUM you didn’t pass in a valid string to search for, if it’s GL_INVALID_OPERATION you tried calling glString between glBegin and glEnd which is not allowed.

Here’s some example code:
http://biology.ncsa.uiuc.edu/library/SGI…_html/ch05.html

Hello,

you may also always create a console app and do the following:

In the project settings in the linker tab you can set the entry point (initially blank) to “mainCRTStartup” or “WinMain” (without quotes). So you can select if you want start in main() or WinMain(). (Note: If you do not have a input-box for this option you can set it manually with the /entry flag. For example: /entry:“mainCRTStartup”)
mainCRTStartup() is an internal windows function which calls main() itself.

The console window can be hidden/shown by using the /subsystem flag. Add the following to the linker options list: /subsystem:windows or /subsystem:console

Another usefull liker option is /opt:nowin98
It reduces the PE header oversize, resulting in a smaller executeable.

However, i use VC98 and i dont know if it all works with later versions.

  1. You must have a valid rendering context to call this function.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.