MCPcopy Create free account
hub / github.com/BabylonJS/BabylonNative / InitInstance

Function InitInstance

Apps/Playground/Win32/App.cpp:239–257  ·  view source on GitHub ↗

FUNCTION: InitInstance(HINSTANCE, int) PURPOSE: Saves instance handle and creates main window COMMENTS: In this function, we save the instance handle in a global variable and create and display the main program window.

Source from the content-addressed store, hash-verified

237// create and display the main program window.
238//
239BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
240{
241 hInst = hInstance; // Store instance handle in our global variable
242
243 HWND hWnd = CreateWindowW(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,
244 CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, nullptr, nullptr, hInstance, nullptr);
245
246 if (!hWnd)
247 {
248 return FALSE;
249 }
250
251 ShowWindow(hWnd, nCmdShow);
252 UpdateWindow(hWnd);
253
254 RefreshBabylon(hWnd);
255
256 return TRUE;
257}
258
259//
260// FUNCTION: WndProc(HWND, UINT, WPARAM, LPARAM)

Callers 1

wWinMainFunction · 0.70

Calls 1

RefreshBabylonFunction · 0.85

Tested by

no test coverage detected