RtB/src/RenderView.hpp

29 lines
1.0 KiB
C++

/* ================================================================
RenderView
----------------
This header file describes our RenderView object.
A RenderView is the target of a RenderCamera and consists of a framebuffer
object and shader program to render said framebuffer. For all intents and
purposes, it is a wrapper around a FBO.
================================================================ */
#ifndef RENDERVIEW_HPP
#define RENDERVIEW_HPP
#include "GL.hpp"
class RenderView {
friend class RenderCamera;
public:
RenderView(unsigned int width, unsigned int height);
~RenderView();
private:
GLuint program; // Compiled shader program to render with
GLuint fbo; // The fbo that RenderCamera will draw to
GLuint fbo_depth; // The fbo depth buffer
GLuint fbo_tex; // The texture of the fbo
unsigned int w, h; // width and height of this view (also of fbo)
int x, y; // x and y offsets of rendering to screen
int createView(unsigned int width, unsigned int height);
int destroyView();
};
#endif