--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403537
This commit is contained in:
Sam Lantinga 2009-02-17 05:57:54 +00:00
parent 90b4c6937f
commit a0978cdf4d
2 changed files with 28 additions and 27 deletions

View file

@ -12,10 +12,10 @@ NativeWindowFactory Win32WindowFactory = {
DestroyWindowWin32 DestroyWindowWin32
}; };
LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) LRESULT CALLBACK
{ WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
switch(msg)
{ {
switch (msg) {
case WM_CLOSE: case WM_CLOSE:
DestroyWindow(hwnd); DestroyWindow(hwnd);
break; break;
@ -45,16 +45,17 @@ CreateWindowWin32(int w, int h)
wc.lpszMenuName = NULL; wc.lpszMenuName = NULL;
wc.lpszClassName = "SDL Test"; wc.lpszClassName = "SDL Test";
if(!RegisterClass(&wc)) if (!RegisterClass(&wc)) {
{
MessageBox(NULL, "Window Registration Failed!", "Error!", MessageBox(NULL, "Window Registration Failed!", "Error!",
MB_ICONEXCLAMATION | MB_OK); MB_ICONEXCLAMATION | MB_OK);
return 0; return 0;
} }
hwnd = CreateWindow("SDL Test", "", WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, w, h, NULL, NULL, GetModuleHandle(NULL), NULL); hwnd =
if(hwnd == NULL) CreateWindow("SDL Test", "", WS_OVERLAPPEDWINDOW, CW_USEDEFAULT,
{ CW_USEDEFAULT, w, h, NULL, NULL, GetModuleHandle(NULL),
NULL);
if (hwnd == NULL) {
MessageBox(NULL, "Window Creation Failed!", "Error!", MessageBox(NULL, "Window Creation Failed!", "Error!",
MB_ICONEXCLAMATION | MB_OK); MB_ICONEXCLAMATION | MB_OK);
return 0; return 0;