1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- #pragma once
- #include <glad/glad.h>
- #include <GLFW/glfw3.h>
- #include <imgui.h>
- #include <imgui_impl_glfw.h>
- #include <imgui_impl_opengl3.h>
- #include "Audio.h"
- struct Color {
- float r;
- float g;
- float b;
- float a;
- static Color color_from_short(uint8_t r, uint8_t g, uint8_t b,
- uint8_t alpha) {
- Color c;
- c.r = r / 256.0f;
- c.g = g / 256.0f;
- c.b = b / 256.0f;
- c.a = alpha / 256.0f;
- return c;
- }
- };
- class BaseWindow {
- public:
- BaseWindow(int width, int height, const char *title, Color clear_color,
- Audio *audio_handler);
- ~BaseWindow();
- int run();
- private:
- Color m_clear_color = {0};
- int m_window_width;
- int m_window_height;
- const char *m_window_title;
- GLFWwindow *m_window{};
- Audio *m_audio_handler;
- };
|