mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-18 16:59:19 +02:00
reformat: parameters can be made const
This commit is contained in:
@@ -14,36 +14,36 @@ gl::framebuffer::~framebuffer()
|
||||
glDeleteFramebuffers(1, *this);
|
||||
}
|
||||
|
||||
void gl::framebuffer::bind(GLuint id)
|
||||
void gl::framebuffer::bind(const GLuint id)
|
||||
{
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, id);
|
||||
}
|
||||
|
||||
void gl::framebuffer::attach(const opengl_texture &tex, GLenum location)
|
||||
void gl::framebuffer::attach(const opengl_texture &tex, const GLenum location)
|
||||
{
|
||||
bind();
|
||||
glFramebufferTexture2D(GL_FRAMEBUFFER, location, tex.target, tex.id, 0);
|
||||
}
|
||||
|
||||
void gl::framebuffer::attach(const opengl_texture &tex, GLenum location, GLint layer)
|
||||
void gl::framebuffer::attach(const opengl_texture &tex, const GLenum location, const GLint layer)
|
||||
{
|
||||
bind();
|
||||
glFramebufferTextureLayer(GL_FRAMEBUFFER, location, tex.id, 0, layer);
|
||||
}
|
||||
|
||||
void gl::framebuffer::attach(const cubemap &tex, int face, GLenum location)
|
||||
void gl::framebuffer::attach(const cubemap &tex, const int face, const GLenum location)
|
||||
{
|
||||
bind();
|
||||
glFramebufferTexture2D(GL_FRAMEBUFFER, location, GL_TEXTURE_CUBE_MAP_POSITIVE_X + face, *tex, 0);
|
||||
}
|
||||
|
||||
void gl::framebuffer::attach(const renderbuffer &rb, GLenum location)
|
||||
void gl::framebuffer::attach(const renderbuffer &rb, const GLenum location)
|
||||
{
|
||||
bind();
|
||||
glFramebufferRenderbuffer(GL_FRAMEBUFFER, location, GL_RENDERBUFFER, *rb);
|
||||
}
|
||||
|
||||
void gl::framebuffer::detach(GLenum location)
|
||||
void gl::framebuffer::detach(const GLenum location)
|
||||
{
|
||||
bind();
|
||||
glFramebufferRenderbuffer(GL_FRAMEBUFFER, location, GL_RENDERBUFFER, 0);
|
||||
@@ -62,7 +62,7 @@ bool gl::framebuffer::is_complete()
|
||||
return iscomplete;
|
||||
}
|
||||
|
||||
void gl::framebuffer::clear(GLbitfield mask)
|
||||
void gl::framebuffer::clear(const GLbitfield mask)
|
||||
{
|
||||
bind();
|
||||
if (mask & GL_DEPTH_BUFFER_BIT)
|
||||
@@ -70,17 +70,17 @@ void gl::framebuffer::clear(GLbitfield mask)
|
||||
glClear(mask);
|
||||
}
|
||||
|
||||
void gl::framebuffer::blit_to(framebuffer *other, int w, int h, GLbitfield mask, GLenum attachment)
|
||||
void gl::framebuffer::blit_to(framebuffer *other, const int w, const int h, const GLbitfield mask, const GLenum attachment)
|
||||
{
|
||||
blit(this, other, 0, 0, w, h, mask, attachment);
|
||||
}
|
||||
|
||||
void gl::framebuffer::blit_from(framebuffer *other, int w, int h, GLbitfield mask, GLenum attachment)
|
||||
void gl::framebuffer::blit_from(framebuffer *other, const int w, const int h, const GLbitfield mask, const GLenum attachment)
|
||||
{
|
||||
blit(other, this, 0, 0, w, h, mask, attachment);
|
||||
}
|
||||
|
||||
void gl::framebuffer::blit(framebuffer *src, framebuffer *dst, int sx, int sy, int w, int h, GLbitfield mask, GLenum attachment)
|
||||
void gl::framebuffer::blit(framebuffer *src, framebuffer *dst, const int sx, const int sy, const int w, const int h, const GLbitfield mask, const GLenum attachment)
|
||||
{
|
||||
glBindFramebuffer(GL_READ_FRAMEBUFFER, src ? *src : 0);
|
||||
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, dst ? *dst : 0);
|
||||
@@ -108,7 +108,7 @@ void gl::framebuffer::blit(framebuffer *src, framebuffer *dst, int sx, int sy, i
|
||||
unbind();
|
||||
}
|
||||
|
||||
void gl::framebuffer::setup_drawing(int attachments)
|
||||
void gl::framebuffer::setup_drawing(const int attachments)
|
||||
{
|
||||
bind();
|
||||
const GLenum a[8] =
|
||||
|
||||
Reference in New Issue
Block a user