16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-18 04:19:19 +02:00

Merge remote-tracking branch 'tmj/master' into sim

This commit is contained in:
milek7
2020-10-18 23:35:14 +02:00
244 changed files with 54164 additions and 11636 deletions

View File

@@ -1,6 +1,9 @@
#include "stdafx.h"
#include "framebuffer.h"
#include "Logs.h"
#include "utilities.h"
gl::framebuffer::framebuffer()
{
glGenFramebuffers(1, *this);
@@ -22,6 +25,12 @@ void gl::framebuffer::attach(const opengl_texture &tex, GLenum location)
glFramebufferTexture2D(GL_FRAMEBUFFER, location, tex.target, tex.id, 0);
}
void gl::framebuffer::attach(const opengl_texture &tex, GLenum location, GLint layer)
{
bind();
glFramebufferTextureLayer(GL_FRAMEBUFFER, location, tex.id, 0, layer);
}
void gl::framebuffer::attach(const cubemap &tex, int face, GLenum location)
{
bind();
@@ -43,8 +52,14 @@ void gl::framebuffer::detach(GLenum location)
bool gl::framebuffer::is_complete()
{
bind();
GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
return status == GL_FRAMEBUFFER_COMPLETE;
GLenum const status { glCheckFramebufferStatus( GL_FRAMEBUFFER ) };
auto const iscomplete { status == GL_FRAMEBUFFER_COMPLETE };
if( false == iscomplete ) {
ErrorLog( "framebuffer status: error " + to_hex_str( status ) );
}
return iscomplete;
}
void gl::framebuffer::clear(GLbitfield mask)