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

multisampling

This commit is contained in:
milek7
2018-07-13 00:32:25 +02:00
parent c94820e8b7
commit 0acf2da5c1
10 changed files with 96 additions and 52 deletions

View File

@@ -17,8 +17,11 @@ void gl::renderbuffer::bind(GLuint id)
glBindRenderbuffer(GL_RENDERBUFFER, id);
}
void gl::renderbuffer::alloc(GLuint format, int width, int height)
void gl::renderbuffer::alloc(GLuint format, int width, int height, int samples)
{
bind();
glRenderbufferStorage(GL_RENDERBUFFER, format, width, height);
if (samples == 1)
glRenderbufferStorage(GL_RENDERBUFFER, format, width, height);
else
glRenderbufferStorageMultisample(GL_RENDERBUFFER, samples, format, width, height);
}