[nostalgia] Add scaffolding for ImGui

This commit is contained in:
2021-05-16 13:04:32 -05:00
parent 63e46d7bb4
commit bae1f05038
7 changed files with 72 additions and 5 deletions

View File

@ -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
)

View File

@ -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;

View File

@ -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);
}