aboutsummaryrefslogtreecommitdiff
path: root/core/src/Entrypoint/Backend_OpenGL2.cpp
diff options
context:
space:
mode:
authorrtk0c <[email protected]>2021-05-06 21:56:40 -0700
committerrtk0c <[email protected]>2021-05-06 21:56:40 -0700
commit1fd1e4b5f2418e3ac2909658993bfedb615537ec (patch)
tree6de080d2273890f8a74d7fcd3572bb44f44ac545 /core/src/Entrypoint/Backend_OpenGL2.cpp
parent538e804fc9beb83e711a210ffbb6badc15f285d5 (diff)
Change brace style to on new line, add initial deliveries view when an order entry is selected
Diffstat (limited to 'core/src/Entrypoint/Backend_OpenGL2.cpp')
-rw-r--r--core/src/Entrypoint/Backend_OpenGL2.cpp21
1 files changed, 14 insertions, 7 deletions
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 <backend/imgui_impl_opengl2.cpp>
-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> RenderingBackend::CreateOpenGL2Backend() {
+std::unique_ptr<RenderingBackend> RenderingBackend::CreateOpenGL2Backend()
+{
try {
return std::make_unique<OpenGL2Backend>();
} catch (std::exception& e) {
@@ -91,7 +97,8 @@ std::unique_ptr<RenderingBackend> RenderingBackend::CreateOpenGL2Backend() {
#else // ^^ BUILD_CORE_WITH_OPENGL2_BACKEND | !BUILD_CORE_WITH_OPENGL2_BACKEND vv
-std::unique_ptr<RenderingBackend> RenderingBackend::CreateOpenGL2Backend(){}() {
+std::unique_ptr<RenderingBackend> RenderingBackend::CreateOpenGL2Backend(){}()
+{
return nullptr;
}