[nostalgia] Add scaffolding for ImGui
This commit is contained in:
@ -5,10 +5,20 @@ add_library(
|
||||
)
|
||||
|
||||
find_package(glfw3 REQUIRED)
|
||||
find_package(imgui REQUIRED)
|
||||
|
||||
if(APPLE)
|
||||
find_package(OpenGL REQUIRED)
|
||||
else()
|
||||
set(OPENGL_gl_LIBRARY GL)
|
||||
endif()
|
||||
|
||||
target_link_libraries(
|
||||
NostalgiaCore-GLFW PUBLIC
|
||||
${OPENGL_gl_LIBRARY}
|
||||
glfw::glfw
|
||||
imgui::imgui
|
||||
imgui-glfw
|
||||
NostalgiaGlUtils
|
||||
NostalgiaCore-Userspace
|
||||
)
|
||||
|
@ -13,7 +13,7 @@
|
||||
namespace nostalgia::core {
|
||||
|
||||
struct GlfwImplData {
|
||||
class GLFWwindow *window = nullptr;
|
||||
struct GLFWwindow *window = nullptr;
|
||||
int64_t startTime = 0;
|
||||
bool running = false;
|
||||
event_handler eventHandler = nullptr;
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
|
||||
#include <GLFW/glfw3.h>
|
||||
#include <imgui.h>
|
||||
#include <imgui_impl_glfw.h>
|
||||
|
||||
#include <nostalgia/core/userland/gfx.hpp>
|
||||
|
||||
@ -37,6 +39,7 @@ ox::Error initGfx(Context *ctx) noexcept {
|
||||
glfwSetWindowUserPointer(id->window, ctx);
|
||||
glfwMakeContextCurrent(id->window);
|
||||
oxReturnError(renderer::init(ctx));
|
||||
ImGui_ImplGlfw_InitForOpenGL(id->window, true);
|
||||
return OxError(0);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user