Skip to content

Commit

Permalink
fix(renderer): add font support for Vulkan renderer (#32)
Browse files Browse the repository at this point in the history
Co-authored-by: maybegreat48 <email@hostname>
  • Loading branch information
maybegreat48 and maybegreat48 authored Oct 8, 2023
1 parent 6bde45e commit b9a67ac
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
10 changes: 7 additions & 3 deletions src/core/renderer/Renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ namespace YimMenu
}

// never returns false, useless to check return
ImGui::CreateContext();
ImGui::CreateContext(&GetInstance().m_FontAtlas);
ImGui_ImplWin32_Init(Pointers.Hwnd);
ImGui_ImplDX12_Init(m_Device.Get(),
m_SwapChainDesc.BufferCount,
Expand Down Expand Up @@ -299,6 +299,10 @@ namespace YimMenu
vkDestroyDevice(m_VkFakeDevice, m_VkAllocator);
m_VkFakeDevice = NULL;

ImGui::CreateContext(&GetInstance().m_FontAtlas);
ImGui_ImplWin32_Init(Pointers.Hwnd);


LOG(INFO) << "Vulkan renderer has finished initializing.";

return true;
Expand Down Expand Up @@ -544,7 +548,7 @@ namespace YimMenu
return;
}

ImGui::CreateContext();
ImGui::CreateContext(&GetInstance().m_FontAtlas);
ImGui_ImplWin32_Init(Pointers.Hwnd);

SetResizing(false);
Expand Down Expand Up @@ -589,7 +593,7 @@ namespace YimMenu

if (!ImGui::GetCurrentContext())
{
ImGui::CreateContext();
ImGui::CreateContext(&GetInstance().m_FontAtlas);
ImGui_ImplWin32_Init(Pointers.Hwnd);
}

Expand Down
3 changes: 3 additions & 0 deletions src/core/renderer/Renderer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,9 @@ namespace YimMenu
private:
bool m_Resizing;

// Shared
ImFontAtlas m_FontAtlas;

//DX12
std::vector<FrameContext> m_FrameContext;

Expand Down
4 changes: 1 addition & 3 deletions src/game/hooks/Info/NetworkRequest.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#include "core/hooking/DetourHook.hpp"
#include "game/hooks/Hooks.hpp"

#define LOG_REQUESTS 0

namespace YimMenu::Hooks
{
#pragma pack(push, 8)
Expand Down Expand Up @@ -49,7 +47,7 @@ namespace YimMenu::Hooks

uint8_t* Info::NetworkRequest(HttpRequest* Request, uint8_t* a2, uint32_t a3)
{
#if LOG_REQUESTS
#if 0
LOG(INFO) << "URL: " << Request->GetFull();
#endif
return BaseHook::Get<Info::NetworkRequest, DetourHook<decltype(&Info::NetworkRequest)>>()->Original()(Request, a2, a3);
Expand Down

0 comments on commit b9a67ac

Please sign in to comment.