refactor: Renderer (#694)

* Simplified SwapCHain, Device and DeviceContext pointers
* Added DX and WndProc callback registration
* Cleaned up GUI code
* Optimised Mouse Toggle
This commit is contained in:
Yimura
2022-12-16 18:55:55 +01:00
committed by GitHub
parent 8704597202
commit f2f3c28048
15 changed files with 219 additions and 131 deletions

View File

@ -300,7 +300,7 @@ namespace big
continue;
}
if (g_gui.m_opened)
if (g_gui->is_open())
{
script::get_current()->yield();
continue;

View File

@ -2,6 +2,7 @@
#include "fiber_pool.hpp"
#include "util/teleport.hpp"
#include "hotkey_functions.hpp"
#include "renderer.hpp"
#include "network/ChatData.hpp"
#include "pointers.hpp"
@ -14,6 +15,11 @@ namespace big
register_hotkey("objective", g->settings.hotkeys.teleport_objective, teleport::to_objective);
register_hotkey("noclip", g->settings.hotkeys.noclip, hotkey_funcs::toggle_noclip);
g_renderer->add_wndproc_callback([this](HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
{
wndproc(static_cast<eKeyState>(msg), wparam);
});
g_hotkey_service = this;
}

View File

@ -115,7 +115,7 @@ namespace big
m_loop_running = true;
while (
g_running && m_running && g_gui.m_opened &&
g_running && m_running && g_gui->is_open() &&
(m_ped_model_hash|| m_veh_model_hash)
) {
Vector3 location;

View File

@ -1,9 +1,12 @@
#include "notification_service.hpp"
#include "widgets/imgui_hotkey.hpp"
namespace big
{
notification_service::notification_service()
{
push("Welcome", std::format("Loaded YimMenu. Press {} to open", ImGui::key_names[g->settings.hotkeys.menu_toggle]));
g_notification_service = this;
}