MCPcopy Create free account
hub / github.com/aliasIsolation/aliasIsolation / InitMenu

Method InitMenu

src/dll/menu.cpp:215–245  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

213}
214
215void Menu::InitMenu(IDXGISwapChain &swapChain)
216{
217 loadSettings(&g_settings);
218
219 SetupDeviceAndContext(swapChain);
220
221 IMGUI_CHECKVERSION();
222 ImGui::CreateContext();
223 ImGuiIO &io = ImGui::GetIO();
224 (void)io;
225 io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard;
226 io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad;
227
228 doMenuStyling();
229
230 // Get the swapchain description (we use this to get the handle to the game's window).
231 DXGI_SWAP_CHAIN_DESC dxgiSwapChainDesc;
232 DX_CHECK(g_pSwapChain->GetDesc(&dxgiSwapChainDesc));
233
234 g_hWindow = dxgiSwapChainDesc.OutputWindow;
235 // Replace the game's window handler with our own so we can intercept key events in the game.
236 g_originalWndProcHandler = reinterpret_cast<WNDPROC>(
237 SetWindowLongPtr(g_hWindow, GWLP_WNDPROC, reinterpret_cast<LONG_PTR>(Menu::WndProcHandler)));
238
239 ImGui_ImplWin32_Init(g_hWindow);
240 ImGui_ImplDX11_Init(g_pd3dDevice, g_pd3dDeviceContext);
241
242 Menu::CreateRenderTarget();
243
244 g_menuInitialised = true;
245}
246
247void Menu::DrawMenu()
248{

Callers

nothing calls this directly

Calls 3

loadSettingsFunction · 0.85
SetupDeviceAndContextFunction · 0.85
doMenuStylingFunction · 0.85

Tested by

no test coverage detected