aboutsummaryrefslogtreecommitdiff
path: root/src/buffer/frame/texture_framebuffer.h
blob: f6b20e6293e4e920f296dba36f28ee156d4ffa2c (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
28
29
30
31
32
#pragma once

#include <cstdint>

#include <GL/glew.h>

class TextureFramebuffer {
private:
	GLuint _id;
	GLuint _texture;

	bool _good = false;

public:
	struct Guard {
		const GLuint _id;

		Guard(GLuint id);
		~Guard();
	};

	Guard use() const;

	TextureFramebuffer(std::size_t width, std::size_t height);
	~TextureFramebuffer();

	bool isGood() const;

	void resize(std::size_t width, std::size_t height) const;

	GLuint getTexture() const;
};