From e39eb11f760416526dce930db81052783efad6e6 Mon Sep 17 00:00:00 2001 From: Archie Jaskowicz Date: Sun, 1 Dec 2024 21:05:49 +0000 Subject: [PATCH] refactor: corrected some comments and vars, incremented version --- include/engine/window.h | 10 +++++----- src/engine/window.cpp | 12 +++++------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/include/engine/window.h b/include/engine/window.h index 1fe75f1..4af0695 100644 --- a/include/engine/window.h +++ b/include/engine/window.h @@ -32,12 +32,12 @@ class window { struct GLFWwindow* glfw_window{nullptr}; - uint16_t frame_width{0}; // vid_reader.height - uint16_t frame_height{0}; // vid_reader.height + uint16_t frame_width { 0 }; // vid_reader.height + uint16_t frame_height { 0 }; // vid_reader.height GLuint video_texture; - glm::vec2 vertices[4] = {{-1, -1}, {-1, 1}, {1, 1}, {1, -1}}; + glm::vec2 vertices[4] = { {-1, -1}, {-1, 1}, {1, 1}, {1, -1} }; void render_window_bar(); @@ -47,8 +47,8 @@ class window { // This is a temp solution to forcing a video to play next frame. std::string force_video_to_play{}; - int button_texture_width = 0; - int button_texture_height = 0; + int button_texture_width { 0 }; + int button_texture_height { 0 }; GLuint button_texture{}; GLuint hovered_button_texture{}; GLuint pressed_button_texture{}; diff --git a/src/engine/window.cpp b/src/engine/window.cpp index 70acc00..cced583 100644 --- a/src/engine/window.cpp +++ b/src/engine/window.cpp @@ -39,7 +39,7 @@ window::window() { exit(EXIT_FAILURE); } - glfw_window = glfwCreateWindow(1280, 720, "Hexwave - 0.2", nullptr, nullptr); + glfw_window = glfwCreateWindow(1280, 720, "Hexwave - 0.3", nullptr, nullptr); if (!glfw_window) { std::cout << "Failed to create window." << "\n"; @@ -152,7 +152,7 @@ window::window() { * End of ImGUI stuff */ - result = ma_engine_init(NULL, &engine); + result = ma_engine_init(nullptr, &engine); if (result != MA_SUCCESS) { std::cerr << "Failed to initialize audio engine." << "\n"; abort(); @@ -181,18 +181,16 @@ void window::window_loop() { ma_device_config device_config{}; ma_device device{}; - bool started_audio = false; - int window_width{0}; int window_height{0}; int prev_window_width{ 0 }; int prev_window_height{ 0 }; - ImVec2 uv0 = ImVec2(0.0f, 0.0f); // UV coordinates for lower-left - ImVec2 uv1 = ImVec2(1, 1); + ImVec2 uv0 = ImVec2(0.0f, 0.0f); // UV coordinates for lower-left + ImVec2 uv1 = ImVec2(1, 1); // UV coordinates for upper-right - ImVec4 bg_col = ImVec4(0.0f, 0.0f, 0.0f, 1.0f); // No Background + ImVec4 bg_col = ImVec4(0.0f, 0.0f, 0.0f, 1.0f); // No Background ImVec4 tint_col = ImVec4(1.0f, 1.0f, 1.0f, 1.0f); // No tint while (!glfwWindowShouldClose(glfw_window)) {