our_dick/include/sprite_renderer.hpp
2020-10-11 12:36:05 -07:00

50 lines
1.3 KiB
C++

/**
This file is a part of our_dick
Copyright (C) 2020 rexy712
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef OUR_DICK_SPRITE_RENDERER_HPP
#define OUR_DICK_SPRITE_RENDERER_HPP
#include "graphics/texture.hpp"
#include "graphics/rbo.hpp"
#include "graphics/fbo.hpp"
#include "sprite_shader.hpp"
#include "math/math.hpp"
#include "scene.hpp"
class sprite_renderer
{
private:
gfx::texture m_fb_colorbuffer;
gfx::rbo m_fb_depthbuffer;
gfx::fbo m_framebuffer;
sprite_shader m_sprite_shader;
public:
sprite_renderer(int width, int height);
void set_vp_matrix(const math::mat4<GLfloat>& vp);
void render(scene& s);
gfx::texture& color_buffer();
void resize_viewport(int width, int height);
const math::vec4<GLfloat>& get_viewport()const;
};
#endif