[nostaliga/core] Add Drawer system and make ImGui use configurable
This commit is contained in:
@@ -7,9 +7,8 @@
|
||||
*/
|
||||
|
||||
#include <GLFW/glfw3.h>
|
||||
#include <imgui.h>
|
||||
#include <imgui_impl_glfw.h>
|
||||
|
||||
#include <nostalgia/core/config.hpp>
|
||||
#include <nostalgia/core/userland/gfx.hpp>
|
||||
|
||||
#include "core.hpp"
|
||||
@@ -38,14 +37,15 @@ ox::Error initGfx(Context *ctx) noexcept {
|
||||
}
|
||||
glfwSetWindowUserPointer(id->window, ctx);
|
||||
glfwMakeContextCurrent(id->window);
|
||||
IMGUI_CHECKVERSION();
|
||||
ImGui::CreateContext();
|
||||
auto &io = ImGui::GetIO();
|
||||
io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard;
|
||||
io.MouseDrawCursor = true;
|
||||
ImGui_ImplGlfw_InitForOpenGL(id->window, true);
|
||||
oxReturnError(renderer::init(ctx));
|
||||
return OxError(0);
|
||||
if constexpr(config::ImGuiEnabled) {
|
||||
IMGUI_CHECKVERSION();
|
||||
ImGui::CreateContext();
|
||||
auto &io = ImGui::GetIO();
|
||||
io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard;
|
||||
io.MouseDrawCursor = true;
|
||||
ImGui_ImplGlfw_InitForOpenGL(id->window, true);
|
||||
}
|
||||
return renderer::init(ctx);
|
||||
}
|
||||
|
||||
ox::Error shutdownGfx(Context *ctx) noexcept {
|
||||
|
||||
Reference in New Issue
Block a user