#pragma once

namespace render
{
    class font;
}

#include <list>

#include "../common.h"
#include "primitives.h"
#include "type.h"
#include "camera.h"
#include "core/shader.h"
#include "texture.h"
#include "buffer.h"


namespace render
{
    enum class blendMode
    {
        normal = 0,
        add
    };

    void init();
    void free();

    void setClearColor(const color::rgba& = color::black);
    void clearScreen();
    void flush();

    const camera *getActiveCamera();

    void mode2D();
    void mode3D();

    void viewport(const vec2u32 &size, const vec2i32 &offset = vec2f());
    void setBlendMode(blendMode);

    const texture *getActiveTexture(int slot);
    const shader *getActiveShader();

    void bindTexture(const texture*, int slot);
    void bindShader(const shader*,bool=true);
    void bindCamera(const camera*);

    void loadCurrentCamera();

    void setModelMatrix(const glm::mat4&);
    void unsetModelMatrix();

    void setMode(uint32_t);

    void lock();
    void unlock();
}

