MCPcopy Create free account
hub / github.com/ClassiCube/ClassiCube / Window_Create

Function Window_Create

src/Window_OS2.c:302–323  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

300}
301
302void Window_Create(int width, int height) {
303 ULONG ulFlags = FCF_SHELLPOSITION | FCF_TASKLIST
304 | FCF_SIZEBORDER | FCF_ICON | FCF_MAXBUTTON |FCF_MINBUTTON
305 | FCF_MAXBUTTON | FCF_TITLEBAR | FCF_SYSMENU;
306
307 if (!WinRegisterClass(habAnchor, CC_WIN_CLASSNAME, ClientWndProc, 0, 0)) {
308 Process_Abort2(LOUSHORT(WinGetLastError(habAnchor)), "Window class registration failed");
309 }
310 hwndFrame = WinCreateStdWindow(HWND_DESKTOP, WS_VISIBLE | WS_SYNCPAINT, &ulFlags,
311 CC_WIN_CLASSNAME, "ClassiCube", 0L, NULLHANDLE, 0, &hwndClient);
312 if (hwndFrame == NULLHANDLE) {
313 Process_Abort2(LOUSHORT(WinGetLastError(habAnchor)), "Failed to create window");
314 }
315 Window_SetSize(width, height);
316 Window_Main.Exists = true;
317 Window_Main.Handle.ptr = &hwndFrame;
318 Window_Main.Focused = TRUE;
319
320 WinSetVisibleRegionNotify(hwndClient, TRUE);
321 // Send an invlaidation message to the client.
322 WinPostMsg(hwndFrame, WM_VRNENABLED, 0L, 0L);
323}
324
325void Window_Create2D(int width, int height) {
326 Window_Create(width, height);

Callers 2

Window_Create2DFunction · 0.85
Window_Create3DFunction · 0.85

Calls 2

Process_Abort2Function · 0.70
Window_SetSizeFunction · 0.70

Tested by

no test coverage detected