#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;
        c.g = g/256;
        c.b = b/256;
        c.a = alpha/256;

        return c;
    }
};

class BaseWindow {

    public:
    BaseWindow(int width, int height, const char* title, 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;
};