mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-10-17 15:39:20 +02:00
A template defined in a module interface is instantiated in the importing unit, where its body's types must be complete. A declaration reaching the importer only through the interface's global module fragment is not enough for MSVC: cParser::operator>> uses std::stringstream, and every unit that parsed a float got an incomplete type. 526 headers across 161 units, derived from what each interface's template bodies actually name.
43 lines
1.2 KiB
C++
43 lines
1.2 KiB
C++
module;
|
|
#include <cstddef>
|
|
#include "glad/glad.h"
|
|
|
|
export module eu07.gl.framebuffer;
|
|
import eu07.gl.object;
|
|
import eu07.gl.bindable;
|
|
import eu07.gl.renderbuffer;
|
|
import eu07.model.texture;
|
|
import eu07.gl.cubemap;
|
|
|
|
export {
|
|
|
|
|
|
namespace gl
|
|
{
|
|
class framebuffer : public object, public bindable<framebuffer>
|
|
{
|
|
public:
|
|
framebuffer();
|
|
~framebuffer();
|
|
|
|
void attach(const opengl_texture &tex, GLenum location);
|
|
void attach( const opengl_texture &tex, GLenum location, GLint layer );
|
|
void attach(const cubemap &tex, int face, GLenum location);
|
|
void attach(const renderbuffer &rb, GLenum location);
|
|
void setup_drawing(int attachments);
|
|
void detach(GLenum location);
|
|
void clear(GLbitfield mask);
|
|
|
|
bool is_complete();
|
|
void blit_to(framebuffer *other, int w, int h, GLbitfield mask, GLenum attachment);
|
|
void blit_from(framebuffer *other, int w, int h, GLbitfield mask, GLenum attachment);
|
|
|
|
static void blit(framebuffer *src, framebuffer *dst, int sx, int sy, int w, int h, GLbitfield mask, GLenum attachment);
|
|
|
|
using bindable::bind;
|
|
static void bind(GLuint id);
|
|
};
|
|
}
|
|
|
|
} // export
|