Browse Source

添加消息处理函数

master
blobt 4 years ago
parent
commit
8b56ecc402
  1. 16
      main.cpp

16
main.cpp

@ -1,5 +1,19 @@
#include <windows.h> #include <windows.h>
/**
*ÏûÏ¢´¦Àíº¯Êý
*/
LRESULT CALLBACK GLWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg)
{
case WM_CLOSE:
PostQuitMessage(0);
return 0;
}
return DefWindowProc(hwnd, msg, wParam, lParam);
}
INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd) INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
{ {
/*×¢²á´°¿Ú*/ /*×¢²á´°¿Ú*/
@ -12,7 +26,7 @@ INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
wndclass.hIcon = NULL; wndclass.hIcon = NULL;
wndclass.hIconSm = NULL; wndclass.hIconSm = NULL;
wndclass.hInstance = hInstance; wndclass.hInstance = hInstance;
wndclass.lpfnWndProc = NULL;
wndclass.lpfnWndProc = GLWindowProc;
wndclass.lpszClassName = L"GLWindow"; wndclass.lpszClassName = L"GLWindow";
wndclass.lpszMenuName = NULL; wndclass.lpszMenuName = NULL;
wndclass.style = CS_VREDRAW | CS_HREDRAW; wndclass.style = CS_VREDRAW | CS_HREDRAW;

Loading…
Cancel
Save