60 lines
1.5 KiB
C++
60 lines
1.5 KiB
C++
#ifndef RENDERER_H
|
|
#define RENDERER_H
|
|
|
|
#include "pch.hpp"
|
|
|
|
#include "extratools.h"
|
|
|
|
#include "RenderTarget.h"
|
|
|
|
namespace Archimedes {
|
|
|
|
class Renderer {
|
|
|
|
public:
|
|
|
|
|
|
int w, h;
|
|
|
|
glm::vec4 clearColor = { 0.0f, 0.0f, 0.0f, 1.0f };
|
|
|
|
Renderer() : w(0), h(0) {}
|
|
|
|
virtual ~Renderer() {}
|
|
|
|
virtual bool init() = 0;
|
|
|
|
virtual void render() = 0;
|
|
|
|
virtual Shader createShader(const std::string& vs, const std::string& fs, const Shader::LoadType& lt) = 0;
|
|
|
|
virtual void setupShader(Shader& shader) = 0;
|
|
|
|
virtual RenderTarget createRenderTarget(
|
|
VertexBuffer vb,
|
|
IndexArray ia,
|
|
VertexLayout layout,
|
|
Shader& s
|
|
) = 0;
|
|
|
|
virtual void setupRenderTarget(RenderTarget& rt) = 0;
|
|
|
|
virtual void updateRenderTarget(RenderTarget& rt) = 0;
|
|
|
|
virtual void freeRenderTarget(RenderTarget& rt) = 0;
|
|
|
|
virtual void draw(
|
|
const RenderTarget& rt,
|
|
const glm::mat4 world = glm::mat4(1.0f),
|
|
const glm::mat4 view = glm::mat4(1.0f),
|
|
const glm::mat4 proj = glm::mat4(1.0f),
|
|
const glm::vec4 color = { 1.0f, 0.0f, 1.0f, 1.0f }
|
|
) = 0;
|
|
|
|
virtual Renderer* getRendererImpl() = 0;
|
|
|
|
};
|
|
}
|
|
|
|
#endif
|