aboutsummaryrefslogtreecommitdiff
path: root/app/source/Cplt/ImGuiBackend/Backend_OpenGL2.cpp
diff options
context:
space:
mode:
authorrtk0c <[email protected]>2022-11-27 12:04:31 -0800
committerrtk0c <[email protected]>2022-11-27 12:04:31 -0800
commit182c8f8357739f905bbd721006480502435b6b43 (patch)
tree082613a474d863182e2ad8f2167f1643f26e67a3 /app/source/Cplt/ImGuiBackend/Backend_OpenGL2.cpp
parentb01ed99a1cd0c863c8709930658513c04dd70f61 (diff)
Update brace style to match rest of my projectscplt-imgui
Diffstat (limited to 'app/source/Cplt/ImGuiBackend/Backend_OpenGL2.cpp')
-rw-r--r--app/source/Cplt/ImGuiBackend/Backend_OpenGL2.cpp21
1 files changed, 7 insertions, 14 deletions
diff --git a/app/source/Cplt/ImGuiBackend/Backend_OpenGL2.cpp b/app/source/Cplt/ImGuiBackend/Backend_OpenGL2.cpp
index 943a527..e9d05a5 100644
--- a/app/source/Cplt/ImGuiBackend/Backend_OpenGL2.cpp
+++ b/app/source/Cplt/ImGuiBackend/Backend_OpenGL2.cpp
@@ -13,14 +13,12 @@
# define IMGUI_IMPL_OPENGL_LOADER_CUSTOM
# 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.");
@@ -44,8 +42,7 @@ public:
ImGui_ImplOpenGL2_Init();
}
- virtual ~OpenGL2Backend()
- {
+ virtual ~OpenGL2Backend() {
ImGui_ImplOpenGL2_Shutdown();
ImGui_ImplGlfw_Shutdown();
ImGui::DestroyContext();
@@ -54,8 +51,7 @@ public:
glfwTerminate();
}
- virtual void RunUntilWindowClose(void (*windowContent)())
- {
+ virtual void RunUntilWindowClose(void (*windowContent)()) {
while (!glfwWindowShouldClose(mWindow)) {
glfwPollEvents();
@@ -81,14 +77,12 @@ 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) {
@@ -98,8 +92,7 @@ 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;
}