Untitled Game engine no.5  1.0
Renderer.hpp
1 #ifndef RENDERER_API_HPP
2 #define RENDERER_API_HPP
3 #include "Shader.hpp"
4 #include "pch.hpp"
5 #include "Mesh.hpp"
6 #include "Types.hpp"
7 #include "RenderTag.hpp"
8 #include "MeshRenderer.hpp"
9 
10 // forward declare this bad boy
11 namespace Engine {
12  struct Transform;
15  class Renderer {
16  friend struct Transform;
17  public:
19  enum class API {
20  None = 0, OpenGL = 1
21  };
22 
23  public:
24  virtual ~Renderer() = default;
25 
27  virtual void Init() = 0;
28 
30  virtual void Shutdown() = 0;
31 
35  virtual void SetClearColor(unsigned int c) = 0;
36 
38  virtual void Clear() = 0;
39 
43  virtual void AddTag(const std::string& name, RenderTag tag, ViewProjection projection = PROJECTION) = 0;
44 
48  virtual void Submit(const std::string& tag, const Ref <Transform> &transform, const Ref <MeshRenderer>& renderer) = 0;
49 
51  virtual void Flush() = 0;
52 
54  static API GetAPI() { return s_API; }
55 
57  static Uni<Renderer> Create();
58 
59  private:
60  static API s_API;
61  };
62 
63 }
64 #endif
Engine::Renderer::SetClearColor
virtual void SetClearColor(unsigned int c)=0
Engine::Renderer::Flush
virtual void Flush()=0
Render all content in the render queue now!
Engine::Transform
Location, orientation, and scale of an entity.
Definition: Components.hpp:312
Engine::Renderer::Shutdown
virtual void Shutdown()=0
Shutdown the render api.
Engine::Renderer::Create
static Uni< Renderer > Create()
Create the render API.
Definition: Renderer.cpp:9
Engine::Ref
std::shared_ptr< T > Ref
Has stuff for making references a lot more easily shared smart pointer.
Definition: Base.hpp:21
Engine::Renderer::Clear
virtual void Clear()=0
Clear the screen.
Engine::Renderer::AddTag
virtual void AddTag(const std::string &name, RenderTag tag, ViewProjection projection=PROJECTION)=0
Engine::RenderTag
Definition: RenderTag.hpp:31
Engine::Renderer::API
API
Rendering system api enumeration.
Definition: Renderer.hpp:19
Engine::Renderer::Submit
virtual void Submit(const std::string &tag, const Ref< Transform > &transform, const Ref< MeshRenderer > &renderer)=0
Engine::Renderer::Init
virtual void Init()=0
Initialize the render api.
Engine::Renderer::GetAPI
static API GetAPI()
Get the current api we are using.
Definition: Renderer.hpp:54
Engine
Definition: Animation.hpp:14
Engine::Uni
std::unique_ptr< T > Uni
Has stuff for making references a lot more easily shared smart pointer representing a unique object.
Definition: Base.hpp:12
Engine::Renderer
Definition: Renderer.hpp:15