[nostalgia] Collapse NostalgiaCore down to a single library and cleanup impl data access

This commit is contained in:
2022-02-03 19:57:43 -06:00
parent d4e903b593
commit 8174d04b06
20 changed files with 152 additions and 182 deletions
+6 -6
View File
@@ -16,18 +16,14 @@ namespace nostalgia::core {
constexpr auto Scale = 5;
static void handleGlfwError(int err, const char *desc) noexcept {
oxErrf("GLFW error ({}): {}\n", err, desc);
}
void ImGui_Impl_NewFrame() noexcept {
ImGui_ImplGlfw_NewFrame();
oxErrf("GLFW error ({}): {}\n", err, desc);
}
static void handleKeyPress(Context *ctx, int key) noexcept {
switch (key) {
case GLFW_KEY_ESCAPE:
case GLFW_KEY_Q:
shutdown(ctx);
oxIgnoreError(shutdown(ctx));
break;
default:
break;
@@ -41,6 +37,10 @@ static void handleGlfwKeyEvent(GLFWwindow *window, int key, int, int action, int
}
}
void ImGui_Impl_NewFrame() noexcept {
ImGui_ImplGlfw_NewFrame();
}
ox::Error initGfx(Context *ctx) noexcept {
auto id = ctx->windowerData<GlfwImplData>();
glfwSetErrorCallback(handleGlfwError);