inline auto EFT::Render::init_all(IDXGISwapChain* pSwapChain) -> bool
{
DXGI_SWAP_CHAIN_DESC desc;
pSwapChain->GetDesc(&desc);
width = desc.BufferDesc.Width;
height = desc.BufferDesc.Height;
ID3D11Device* device;
pSwapChain->GetDevice(__uuidof(ID3D11Device), reinterpret_cast<void**>(&device));
device->GetImmediateContext(&render_context);
ID3D11Texture2D* BackBuffer;
pSwapChain->GetBuffer(0, __uuidof(ID3D11Texture2D), (LPVOID*)&BackBuffer);
device->CreateRenderTargetView(BackBuffer, NULL, &render_target_view);
BackBuffer->Release();
orig_wnd_proc = SetWindowLongPtr(FindWindow(L"UnityWndClass", NULL), GWLP_WNDPROC, (LONG_PTR)WndProc);
GetWindowRect(desc.OutputWindow, &window_rect);
ImGui::CreateContext();
ImGuiIO& io = ImGui::GetIO(); (void)io;
ImGui::StyleColorsDark();
static ImFontConfig font_config;
font_config.FontBuilderFlags |= ImGuiFreeTypeBuilderFlags_MonoHinting;
static const ImWchar ranges[] =
{
0x0020, 0x00FF, // Basic Latin + Latin Supplement
0x0400, 0x052F, // Cyrillic + Cyrillic Supplement
0x2DE0, 0x2DFF, // Cyrillic Extended-A
0xA640, 0xA69F, // Cyrillic Extended-B
0xE000, 0xE226, // icons
ICON_MIN_FA,ICON_MAX_FA,
0,
};
font_config.GlyphRanges = ranges;
medium = io.Fonts->AddFontFromMemoryTTF(PTRootUIMedium, sizeof(PTRootUIMedium), 15.0f, &font_config, ranges);
bold = io.Fonts->AddFontFromMemoryTTF(PTRootUIBold, sizeof(PTRootUIBold), 15.0f, &font_config, ranges);
tab_icons = io.Fonts->AddFontFromMemoryTTF(clarityfont, sizeof(clarityfont), 15.0f, &font_config, ranges);
logo = io.Fonts->AddFontFromMemoryTTF(clarityfont, sizeof(clarityfont), 21.0f, &font_config, ranges);
fa_logo_size = io.Fonts->AddFontFromMemoryTTF(FaSolid, sizeof(FaSolid), 27.0f, &font_config, ranges);
fa_esp = io.Fonts->AddFontFromMemoryTTF(FaSolid, sizeof(FaSolid), 13.0f, &font_config, ranges);
esp = io.Fonts->AddFontFromMemoryTTF(PTRootUIBold, sizeof(PTRootUIBold), 11.f, &font_config, ranges);
tab_title = io.Fonts->AddFontFromMemoryTTF(PTRootUIBold, sizeof(PTRootUIBold), 19.0f, &font_config, ranges);
tab_title_icon = io.Fonts->AddFontFromMemoryTTF(clarityfont, sizeof(clarityfont), 18.0f, &font_config, ranges);
subtab_title = io.Fonts->AddFontFromMemoryTTF(PTRootUIBold, sizeof(PTRootUIBold), 15.0f, &font_config, ranges);
combo_arrow = io.Fonts->AddFontFromMemoryTTF(combo, sizeof(combo), 9.0f, &font_config, ranges);
ImGui_ImplWin32_Init(desc.OutputWindow);
ImGui_ImplDX11_Init(device, render_context);
static auto domain = VmGeneralType::Domain::Get();
static auto thread = VmGeneralType::Thread::Attach(domain);
return true;
}