MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / Initialize

Method Initialize

ogsr_engine/xr_3da/Device_Initialize.cpp:39–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37extern LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
38
39void CRenderDevice::Initialize()
40{
41 ZoneScoped;
42
43 LogOsVersion();
44 LogWorkingDriveInfo();
45
46 Log("Initializing Engine...");
47 TimerGlobal.Start();
48 TimerMM.Start();
49
50 // Unless a substitute hWnd has been specified, create a window to render into
51 if (m_hWnd == nullptr)
52 {
53 const char* wndclass = "_XRAY_1.5";
54
55 // Register the windows class
56 HINSTANCE hInstance = (HINSTANCE)GetModuleHandle(nullptr);
57 WNDCLASS wndClass = {0, WndProc, 0, 0, hInstance, LoadIcon(hInstance, MAKEINTRESOURCE(IDI_ICON1)), LoadCursor(nullptr, IDC_ARROW), (HBRUSH)GetStockObject(BLACK_BRUSH),
58 nullptr, wndclass};
59 RegisterClass(&wndClass);
60
61 // Set the window's initial style
62 m_dwWindowStyle = WS_BORDER | WS_DLGFRAME;
63
64 // Set the window's initial width
65 RECT rc;
66 SetRect(&rc, 0, 0, 640, 480);
67 AdjustWindowRect(&rc, m_dwWindowStyle, FALSE);
68
69 // Create the render window
70 m_hWnd = CreateWindow /*Ex*/ ( // WS_EX_TOPMOST,
71 wndclass, "OGSR Engine", m_dwWindowStyle,
72 /*rc.left, rc.top, */ CW_USEDEFAULT, CW_USEDEFAULT, (rc.right - rc.left), (rc.bottom - rc.top), 0L, 0, hInstance, 0L);
73 gGameWindow = m_hWnd;
74
75 TracySetProgramName("OGSR Engine");
76 }
77
78 // Save window properties
79 m_dwWindowStyle = u32(GetWindowLongPtr(m_hWnd, GWL_STYLE));
80 GetWindowRect(m_hWnd, &m_rcWindowBounds);
81 GetClientRect(m_hWnd, &m_rcWindowClient);
82
83 /*
84 if (strstr(lpCmdLine,"-gpu_sw")!=NULL) HW.Caps.bForceGPU_SW = TRUE;
85 else HW.Caps.bForceGPU_SW = FALSE;
86 if (strstr(lpCmdLine,"-gpu_nopure")!=NULL) HW.Caps.bForceGPU_NonPure = TRUE;
87 else HW.Caps.bForceGPU_NonPure = FALSE;
88 if (strstr(lpCmdLine,"-gpu_ref")!=NULL) HW.Caps.bForceGPU_REF = TRUE;
89 else HW.Caps.bForceGPU_REF = FALSE;
90 */
91}

Callers

nothing calls this directly

Calls 5

LogOsVersionFunction · 0.85
LogWorkingDriveInfoFunction · 0.85
LogFunction · 0.85
u32Enum · 0.70
StartMethod · 0.45

Tested by

no test coverage detected