| 12
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 
 | #include <windows.h>
 
 
WNDCLASS wc; 
HWND hWnd; 
MSG msg; 
 
LRESULT CALLBACK WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) 
{ 
switch (uMsg) 
{ 
case WM_CLOSE: 
PostQuitMessage (0); 
break; 
default: 
return DefWindowProc (hwnd,uMsg,wParam,lParam); 
break; 
} 
return 0; 
} 
 
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int CmdShow) 
{ 
	wc.style = CS_OWNDC; 
	wc.lpfnWndProc = WindowProc; 
	wc.cbClsExtra = 0; 
	wc.cbWndExtra = 0; 
	wc.hInstance = hInstance; 
	wc.hIcon = LoadIcon(NULL, IDI_APPLICATION); 
	wc.hCursor = LoadCursor(NULL, IDC_ARROW); 
	wc.hbrBackground = (HBRUSH)GetStockObject(LTGRAY_BRUSH); 
	wc.lpszMenuName = NULL; 
	wc.lpszClassName = "OGL"; 
 
	RegisterClass(&wc); 
 
	hWnd = CreateWindow("OGL", "Fenetre OpenGL", 
		WS_CAPTION | WS_POPUPWINDOW | WS_VISIBLE, 
		0, 0, 640, 480, NULL, NULL, hInstance, NULL );
 
	while (GetMessage (&msg, NULL, 0, 0)) { 
		TranslateMessage (&msg); 
		DispatchMessage (&msg); 
	} 
 
	return 0; 
 
} | 
Partager