BLT-With-Graphics-Template/include/blt/gfx/framebuffer.h

51 lines
1.4 KiB
C
Raw Normal View History

2024-04-16 02:43:51 -04:00
#pragma once
/*
* Copyright (C) 2024 Brett Terpstra
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef BLT_WITH_GRAPHICS_FRAMEBUFFER_H
#define BLT_WITH_GRAPHICS_FRAMEBUFFER_H
2024-04-16 03:20:35 -04:00
#include "blt/gfx/gl_includes.h"
2024-04-16 02:43:51 -04:00
namespace blt::gfx
{
2024-04-16 03:20:35 -04:00
class fbo_t
{
public:
enum class fbo_draw_t : GLuint
{
DRAW = GL_DRAW_FRAMEBUFFER,
READ = GL_READ_FRAMEBUFFER,
BOTH = GL_FRAMEBUFFER
};
private:
GLuint fboID;
public:
void create();
void bind(fbo_draw_t type = fbo_draw_t::BOTH) const;
bool validate();
static void unbind();
void destroy();
};
2024-04-16 02:43:51 -04:00
}
#endif //BLT_WITH_GRAPHICS_FRAMEBUFFER_H