2024-08-13 17:47:16 -04:00
|
|
|
#ifndef FBO_H_
|
|
|
|
#define FBO_H_
|
|
|
|
|
|
|
|
#include <GLFW/glfw3.h>
|
|
|
|
|
2024-08-20 00:47:41 -04:00
|
|
|
struct Framebuffer {
|
|
|
|
GLuint id = 0;
|
|
|
|
GLuint albedoTexture = 0;
|
|
|
|
GLuint positionTexture = 0;
|
|
|
|
GLuint normalTexture = 0;
|
|
|
|
GLuint depthTexture = 0;
|
2024-08-13 17:47:16 -04:00
|
|
|
};
|
|
|
|
|
2024-08-20 00:47:41 -04:00
|
|
|
namespace FBO {
|
|
|
|
Framebuffer GenerateFramebuffer(int width, int height);
|
|
|
|
GLuint CreateFramebuffer();
|
|
|
|
GLuint CreateTexture(int width, int height, GLenum format);
|
|
|
|
GLuint CreateDepthTexture(int width, int height);
|
|
|
|
void AttachTextureToFramebuffer(GLuint framebufferId, GLuint textureId, GLenum attachment);
|
|
|
|
void Cleanup(const Framebuffer& fbo);
|
|
|
|
}
|
|
|
|
|
2024-08-13 17:47:16 -04:00
|
|
|
#endif // FBO_H_
|