summaryrefslogtreecommitdiff
path: root/ui/sceneRenderer.h
blob: 9352fc936cd81c5010917449cfa96674cd296d1f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#pragma once

#include "gfx/gl/program.h"
#include "lib/glArrays.h"
#include <functional>
#include <glm/fwd.hpp>

class SceneRenderer {
public:
	explicit SceneRenderer(glm::ivec2 size, GLuint output);

	void render(std::function<void()> content) const;

private:
	GLuint output;
	glFrameBuffer gBuffer;
	glTexture gPosition, gNormal, gAlbedoSpec;
	glRenderBuffer depth;
	class DeferredLightProgram : public Program {
	public:
		using Program::Program;
		using Program::use;
	};
	DeferredLightProgram lighting;
	glVertexArray displayVAO;
	glBuffer displayVBO;
};