#if 0
bool GUI::load()
{
    glClearColor (0.0, 0.0, 0.0, 0.0);

    m_font_manager = new FontManager();

    if (!m_font_manager->load())
        return false;

    if (!load_shaders())
        return false;

    if (!load_buffers())
        return false;

    return true;
}

bool GUI::load_buffers()
{
    static const GLint rect_coords[4][2] = {
        {0, 0},
        {1, 0},
        {0, 1},
        {1, 1},
    };

    m_rect_vbo = new GLBuffer();
    if (!m_rect_vbo->create(GL_ARRAY_BUFFER, GL_STATIC_DRAW, &rect_coords, sizeof(rect_coords)))
    {
        std::cerr << "Failed to create rectangle VBO" << std::endl;
        return false;
    }

    return true;
}

void GUI::resize()
{
    GLint viewport_size[2];
    SDL_GetWindowSize(m_window, &viewport_size[0], &viewport_size[1]);
    glViewport(0, 0, viewport_size[0], viewport_size[1]);
    for (int i = 0; i < PROGRAM_COUNT; i++)
    {
        m_programs[i]->use();
        glUniform2iv(m_programs[i]->get_uniform("viewport_size"), 1, &viewport_size[0]);
    }
}

void GUI::draw()
{
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    SDL_GL_SwapWindow(m_window);
}

void GUI::draw_rect(int x, int y, int width, int height, float r, float g, float b, float a)
{
    m_programs[PROGRAM_RECT]->use();
    glUniform2i(m_programs[PROGRAM_RECT]->get_uniform("position"), x, y);
    glUniform2i(m_programs[PROGRAM_RECT]->get_uniform("size"), width, height);
    glUniform4f(m_programs[PROGRAM_RECT]->get_uniform("color"), r, g, b, a);
    m_rect_vbo->bind();
    glEnableVertexAttribArray(0);
    glVertexAttribIPointer(0, 2, GL_INT, 0, 0);
    glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
}
#endif
