From 1fd1e4b5f2418e3ac2909658993bfedb615537ec Mon Sep 17 00:00:00 2001 From: rtk0c Date: Thu, 6 May 2021 21:56:40 -0700 Subject: Change brace style to on new line, add initial deliveries view when an order entry is selected --- core/src/Entrypoint/Backend_OpenGL2.cpp | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'core/src/Entrypoint/Backend_OpenGL2.cpp') diff --git a/core/src/Entrypoint/Backend_OpenGL2.cpp b/core/src/Entrypoint/Backend_OpenGL2.cpp index 422ad91..8c56b81 100644 --- a/core/src/Entrypoint/Backend_OpenGL2.cpp +++ b/core/src/Entrypoint/Backend_OpenGL2.cpp @@ -12,12 +12,14 @@ # define IMGUI_IMPL_OPENGL_LOADER_GLAD # include -class OpenGL2Backend : public RenderingBackend { +class OpenGL2Backend : public RenderingBackend +{ private: GLFWwindow* mWindow; public: - OpenGL2Backend() { + OpenGL2Backend() + { glfwSetErrorCallback(&GlfwErrorCallback); if (!glfwInit()) { throw std::runtime_error("Failed to initialize GLFW."); @@ -41,7 +43,8 @@ public: ImGui_ImplOpenGL2_Init(); } - virtual ~OpenGL2Backend() { + virtual ~OpenGL2Backend() + { ImGui_ImplOpenGL2_Shutdown(); ImGui_ImplGlfw_Shutdown(); ImGui::DestroyContext(); @@ -50,7 +53,8 @@ public: glfwTerminate(); } - virtual void RunUntilWindowClose(void (*windowContent)()) { + virtual void RunUntilWindowClose(void (*windowContent)()) + { while (!glfwWindowShouldClose(mWindow)) { glfwPollEvents(); @@ -76,12 +80,14 @@ public: } } - static void GlfwErrorCallback(int errorCode, const char* message) { + static void GlfwErrorCallback(int errorCode, const char* message) + { std::cerr << "GLFW Error " << errorCode << ": " << message << "\n"; } }; -std::unique_ptr RenderingBackend::CreateOpenGL2Backend() { +std::unique_ptr RenderingBackend::CreateOpenGL2Backend() +{ try { return std::make_unique(); } catch (std::exception& e) { @@ -91,7 +97,8 @@ std::unique_ptr RenderingBackend::CreateOpenGL2Backend() { #else // ^^ BUILD_CORE_WITH_OPENGL2_BACKEND | !BUILD_CORE_WITH_OPENGL2_BACKEND vv -std::unique_ptr RenderingBackend::CreateOpenGL2Backend(){}() { +std::unique_ptr RenderingBackend::CreateOpenGL2Backend(){}() +{ return nullptr; } -- cgit v1.2.3-70-g09d2