From a7e5e42a188f9e6ab13706a15e6b50f36f0e00e8 Mon Sep 17 00:00:00 2001 From: rtk0c Date: Sun, 28 Mar 2021 15:13:05 -0700 Subject: Fix backend compiling/loading mechanism --- core/src/Entrypoint/OpenGL3.cpp | 37 +++++++++++++++++++++++++++---------- 1 file changed, 27 insertions(+), 10 deletions(-) (limited to 'core/src/Entrypoint/OpenGL3.cpp') diff --git a/core/src/Entrypoint/OpenGL3.cpp b/core/src/Entrypoint/OpenGL3.cpp index c1f66d5..7d5cae1 100644 --- a/core/src/Entrypoint/OpenGL3.cpp +++ b/core/src/Entrypoint/OpenGL3.cpp @@ -1,15 +1,17 @@ #include "OpenGL3.hpp" -#include +#if BUILD_CORE_WITH_OPENGL3_BACKEND +# include +# include +# include +# include +# include +# include -#include -#include -#include -#include -#include +# define IMGUI_IMPL_OPENGL_LOADER_GLAD +# include OpenGL3Backend::OpenGL3Backend() { -#if IMGUI_INCLUDE_OPENGL3_BACKEND glfwSetErrorCallback(GlfwErrorCallback); if (!glfwInit()) { throw std::runtime_error("Failed to initialize GLFW."); @@ -47,9 +49,6 @@ OpenGL3Backend::OpenGL3Backend() { ImGui_ImplGlfw_InitForOpenGL(mWindow, true); ImGui_ImplOpenGL3_Init(glslVersion); -#else - throw std::runtime_error("Backend opengl3 is not available in this build.\n"); -#endif } OpenGL3Backend::~OpenGL3Backend() { @@ -83,3 +82,21 @@ void OpenGL3Backend::EndFrame() { glfwSwapBuffers(mWindow); } + +#else // ^^ BUILD_CORE_WITH_OPENGL3_BACKEND | !BUILD_CORE_WITH_OPENGL3_BACKEND vv +# include + +OpenGL3Backend::OpenGL3Backend() { + throw std::runtime_error("Backend opengl3 is not available in this build.\n"); +} + +OpenGL3Backend::~OpenGL3Backend() { +} + +void OpenGL3Backend::BeginFrame() { +} + +void OpenGL3Backend::EndFrame() { +} + +#endif -- cgit v1.2.3-70-g09d2