Skip to content
Snippets Groups Projects
Renderer.hpp 932 B
Newer Older
  • Learn to ignore specific revisions
  • #pragma once
    
    
    BATON Theau's avatar
    BATON Theau committed
    #include <optional>
    
    
    #include <engine/graphics/utility/reference_sorter.hpp>
    
    BATON Theau's avatar
    BATON Theau committed
    #include <engine/graphics/back/buffers/FrameBuffer.hpp>
    
    #include <engine/graphics/back/cameras/View.hpp>
    
    BATON Theau's avatar
    BATON Theau committed
    
    
    #include <engine/graphics/front/module/ImageModule.hpp>
    
    
    namespace megu {
        class Renderer {
            public:
                Renderer() = delete;
                Renderer(float, float);
               ~Renderer() = default;
                
    
                void render(const Window & w, Renderable & r, const TextureArray & a) {
                    this->clear();
                    r.accept(w, this->_view, this->_module, a);
                }
    
    BATON Theau's avatar
    BATON Theau committed
    
    
    BATON Theau's avatar
    BATON Theau committed
                const glm::vec2 dimension() const {return this->_view.dimension();}
    
                void clear() const;
                void setClearColor(float, float, float, float = 1.f) const;
    
                View & view() {return this->_view;}
    
    
            private:
                View _view;
    
                Image_Module _module;