View Full Version : C++/OpenGL

05-16-2004, 02:28 AM
I do not know much about C++ yet...But i don't really know some lines of code that appear in the beginning of the tutorials in nehe.gamedev.net...

HWND g_hWnd;
// This is the handle for the window
RECT g_rRect;
// This holds the window dimensions
HDC g_hDC;
// General HDC - (handle to device context)
// General OpenGL_DC - Our Rendering Context for OpenGL
HINSTANCE g_hInstance;
// This holds the global hInstance for UnregisterClass() in DeInit()
What the hell is the H***'s and RECT types? and which library contains them?


05-16-2004, 02:39 AM

They are included in Win32 API.

You need to create Win32 project, if you use


05-16-2004, 09:03 AM
Try including windows.h after you created a Win32 Project.

05-16-2004, 11:44 AM
As a matter of fact, i dont use the windows.h. Why is that lib so used, when it is not necessary. Or am i wrong?

05-16-2004, 12:20 PM
Originally posted by KeSh:
Why is that lib so used, when it is not necessary. Or am i wrong?The Win32 API is THE method to create and manage windows (at least under Windows, under Linux it is X11, ...). So when you want to do anything other than text mode it is absolutely neccesary to use it, either directly or indirectly.

If you don't want to use it directly, you have to use some wrapper library like SDL, MFC or simply glut, which in turn makes calls to the Windows API for you.