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_OpenGL3.cpp | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'core/src/Entrypoint/Backend_OpenGL3.cpp') diff --git a/core/src/Entrypoint/Backend_OpenGL3.cpp b/core/src/Entrypoint/Backend_OpenGL3.cpp index 36a0cb3..50dc78f 100644 --- a/core/src/Entrypoint/Backend_OpenGL3.cpp +++ b/core/src/Entrypoint/Backend_OpenGL3.cpp @@ -12,12 +12,14 @@ # define IMGUI_IMPL_OPENGL_LOADER_GLAD # include -class OpenGL3Backend : public RenderingBackend { +class OpenGL3Backend : public RenderingBackend +{ private: GLFWwindow* mWindow; public: - OpenGL3Backend() { + OpenGL3Backend() + { glfwSetErrorCallback(&GlfwErrorCallback); if (!glfwInit()) { throw std::runtime_error("Failed to initialize GLFW."); @@ -57,7 +59,8 @@ public: ImGui_ImplOpenGL3_Init(glslVersion); } - virtual ~OpenGL3Backend() { + virtual ~OpenGL3Backend() + { ImGui_ImplOpenGL3_Shutdown(); ImGui_ImplGlfw_Shutdown(); ImGui::DestroyContext(); @@ -66,7 +69,8 @@ public: glfwTerminate(); } - virtual void RunUntilWindowClose(void (*windowContent)()) { + virtual void RunUntilWindowClose(void (*windowContent)()) + { while (!glfwWindowShouldClose(mWindow)) { glfwPollEvents(); @@ -91,12 +95,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::CreateOpenGL3Backend() { +std::unique_ptr RenderingBackend::CreateOpenGL3Backend() +{ try { return std::make_unique(); } catch (std::exception& e) { @@ -106,7 +112,8 @@ std::unique_ptr RenderingBackend::CreateOpenGL3Backend() { #else // ^^ BUILD_CORE_WITH_OPENGL3_BACKEND | !BUILD_CORE_WITH_OPENGL3_BACKEND vv -std::unique_ptr RenderingBackend::CreateOpenGL3Backend() { +std::unique_ptr RenderingBackend::CreateOpenGL3Backend() +{ return nullptr; } -- cgit v1.2.3-70-g09d2