35 lines
922 B
C++
35 lines
922 B
C++
#ifndef RENDERER2D_HPP
|
|
#define RENDERER2D_HPP
|
|
|
|
#include "open_engine/logging.hpp"
|
|
#include "open_engine/orthographic_camera.hpp"
|
|
#include "open_engine/renderer/texture.hpp"
|
|
#include "open_engine/ref_scope.hpp"
|
|
|
|
#include <glm/fwd.hpp>
|
|
|
|
namespace OpenEngine {
|
|
struct Transform
|
|
{
|
|
glm::vec3 position = {0.0f, 0.0f, 0.0f};
|
|
glm::vec3 size = {1.0f, 1.0f, 1.0f};
|
|
float rotation = 0.0f;
|
|
};
|
|
|
|
class Renderer2D
|
|
{
|
|
public:
|
|
static void Init();
|
|
static void Shutdown();
|
|
|
|
static void BeginScene(const OrthographicCamera& camera);
|
|
static void EndScene();
|
|
static void Flush();
|
|
|
|
static void DrawQuad(const Transform& transform_data, const glm::vec4& color);
|
|
static void DrawQuad(const Transform& transform_data, const Ref<Texture2D>& texture, float tiling_factor = 1.0f);
|
|
};
|
|
}
|
|
|
|
#endif // RENDERER2D_HPP
|