testnativeos2.c: make its code style to match SDL2.

This commit is contained in:
Ozkan Sezer 2021-11-28 23:02:02 +03:00
parent 942973dd86
commit ede73b4cfc

View file

@ -27,28 +27,26 @@ NativeWindowFactory OS2WindowFactory = {
static void *CreateWindowNative(int w, int h) static void *CreateWindowNative(int w, int h)
{ {
HWND hwnd; HWND hwnd, hwndFrame;
HWND hwndFrame;
ULONG ulFrameFlags = FCF_TASKLIST | FCF_DLGBORDER | FCF_TITLEBAR | ULONG ulFrameFlags = FCF_TASKLIST | FCF_DLGBORDER | FCF_TITLEBAR |
FCF_SYSMENU | FCF_SHELLPOSITION | FCF_SYSMENU | FCF_SHELLPOSITION |
FCF_SIZEBORDER | FCF_MINBUTTON | FCF_MAXBUTTON; FCF_SIZEBORDER | FCF_MINBUTTON | FCF_MAXBUTTON;
WinRegisterClass(0, WIN_CLIENT_CLASS, WinDefWindowProc, WinRegisterClass(0, WIN_CLIENT_CLASS, WinDefWindowProc,
CS_SIZEREDRAW | CS_MOVENOTIFY, CS_SIZEREDRAW | CS_MOVENOTIFY,
sizeof(ULONG) ); // We should have minimum 4 bytes. sizeof(ULONG)); /* We should have minimum 4 bytes. */
hwndFrame = WinCreateStdWindow(HWND_DESKTOP, 0, &ulFrameFlags, hwndFrame = WinCreateStdWindow(HWND_DESKTOP, 0, &ulFrameFlags,
WIN_CLIENT_CLASS, "SDL Test", 0, 0, 1, &hwnd); WIN_CLIENT_CLASS, "SDL Test", 0, 0, 1, &hwnd);
if ( hwndFrame == NULLHANDLE ) if (hwndFrame == NULLHANDLE) {
{ return NULL;
return 0;
} }
WinSetWindowPos(hwndFrame, HWND_TOP, 0, 0, w, h, WinSetWindowPos(hwndFrame, HWND_TOP, 0, 0, w, h,
SWP_ZORDER | SWP_ACTIVATE | SWP_SIZE | SWP_SHOW); SWP_ZORDER | SWP_ACTIVATE | SWP_SIZE | SWP_SHOW);
return (void *)hwndFrame; // We may returns client or frame window handle return (void *)hwndFrame; /* We may return client or frame window
// for SDL_CreateWindowFrom(). handle for SDL_CreateWindowFrom(). */
} }
static void DestroyWindowNative(void *window) static void DestroyWindowNative(void *window)