Clang format gui.h and cpp.

This commit is contained in:
Relintai 2024-09-14 12:10:34 +02:00
parent 69988dcae8
commit c30ef4ce1e
2 changed files with 83 additions and 86 deletions

View File

@ -9,9 +9,9 @@
#include "core/math_defs.h"
#include "core/sfw_time.h"
#include "render_core/app_window.h"
#include "render_core/input.h"
#include "render_core/input_map.h"
#include "render_core/app_window.h"
#include "core/sfw_core.h"
#include "object/core_string_names.h"
@ -24,15 +24,14 @@
//--STRIP
void GUI::test() {
ImGuiIO& io = ImGui::GetIO(); (void)io;
ImGuiIO &io = ImGui::GetIO();
(void)io;
// Our state
static bool show_demo_window = true;
static bool show_another_window = false;
static ImVec4 clear_color = ImVec4(0.45f, 0.55f, 0.60f, 1.00f);
// 2. Show a simple window that we create ourselves. We use a Begin/End pair to create a named window.
{
static float f = 0.0f;
@ -45,7 +44,7 @@ void GUI::test() {
ImGui::Checkbox("Another Window", &show_another_window);
ImGui::SliderFloat("float", &f, 0.0f, 1.0f); // Edit 1 float using a slider from 0.0f to 1.0f
ImGui::ColorEdit3("clear color", (float*)&clear_color); // Edit 3 floats representing a color
ImGui::ColorEdit3("clear color", (float *)&clear_color); // Edit 3 floats representing a color
if (ImGui::Button("Button")) // Buttons return true when clicked (most widgets return true when edited/activated)
counter++;
@ -57,8 +56,7 @@ void GUI::test() {
}
// 3. Show another simple window.
if (show_another_window)
{
if (show_another_window) {
ImGui::Begin("Another Window", &show_another_window); // Pass a pointer to our bool variable (the window will have a closing button that will clear the bool when clicked)
ImGui::Text("Hello from another window!");
if (ImGui::Button("Close Me"))
@ -75,16 +73,17 @@ void GUI::initialize() {
// Decide GL+GLSL versions
#if defined(__APPLE__)
// GL 3.2 + GLSL 150
const char* glsl_version = "#version 150";
const char *glsl_version = "#version 150";
#else
// GL ES 2.0 + GLSL 100
const char* glsl_version = "#version 100";
const char *glsl_version = "#version 100";
#endif
// Setup Dear ImGui context
IMGUI_CHECKVERSION();
ImGui::CreateContext();
ImGuiIO& io = ImGui::GetIO(); (void)io;
ImGuiIO &io = ImGui::GetIO();
(void)io;
io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; // Enable Keyboard Controls
io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad; // Enable Gamepad Controls
@ -155,4 +154,3 @@ GUI *GUI::get_singleton() {
}
GUI *GUI::_singleton = NULL;

View File

@ -30,7 +30,6 @@ public:
protected:
static GUI *_singleton;
};
//--STRIP