Commit a0978cdf authored by Sam Lantinga's avatar Sam Lantinga

indent

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403537
parent 90b4c693
...@@ -164,7 +164,7 @@ SDL_SemPost(SDL_sem * sem) ...@@ -164,7 +164,7 @@ SDL_SemPost(SDL_sem * sem)
#else #else
if (ReleaseSemaphore(sem->id, 1, NULL) == FALSE) { if (ReleaseSemaphore(sem->id, 1, NULL) == FALSE) {
#endif #endif
InterlockedDecrement(&sem->count); /* restore */ InterlockedDecrement(&sem->count); /* restore */
SDL_SetError("ReleaseSemaphore() failed"); SDL_SetError("ReleaseSemaphore() failed");
return -1; return -1;
} }
......
...@@ -12,18 +12,18 @@ NativeWindowFactory Win32WindowFactory = { ...@@ -12,18 +12,18 @@ 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;
case WM_DESTROY: case WM_DESTROY:
PostQuitMessage(0); PostQuitMessage(0);
break; break;
default: default:
return DefWindowProc(hwnd, msg, wParam, lParam); return DefWindowProc(hwnd, msg, wParam, lParam);
} }
return 0; return 0;
} }
...@@ -34,29 +34,30 @@ CreateWindowWin32(int w, int h) ...@@ -34,29 +34,30 @@ CreateWindowWin32(int w, int h)
HWND hwnd; HWND hwnd;
WNDCLASS wc; WNDCLASS wc;
wc.style = 0; wc.style = 0;
wc.lpfnWndProc = WndProc; wc.lpfnWndProc = WndProc;
wc.cbClsExtra = 0; wc.cbClsExtra = 0;
wc.cbWndExtra = 0; wc.cbWndExtra = 0;
wc.hInstance = GetModuleHandle(NULL); wc.hInstance = GetModuleHandle(NULL);
wc.hIcon = LoadIcon(NULL, IDI_APPLICATION); wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
wc.hCursor = LoadCursor(NULL, IDC_ARROW); wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1); wc.hbrBackground = (HBRUSH) (COLOR_WINDOW + 1);
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;
} }
...@@ -68,7 +69,7 @@ CreateWindowWin32(int w, int h) ...@@ -68,7 +69,7 @@ CreateWindowWin32(int w, int h)
static void static void
DestroyWindowWin32(void *window) DestroyWindowWin32(void *window)
{ {
DestroyWindow((HWND)window); DestroyWindow((HWND) window);
} }
#endif #endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment