1 #include <msp/gl/extensions/arb_direct_state_access.h>
2 #include <msp/gl/extensions/arb_texture_multisample.h>
3 #include <msp/gl/extensions/arb_texture_storage_multisample.h>
4 #include "texture2dmultisample.h"
5 #include "texture2dmultisample_backend.h"
10 OpenGLTexture2DMultisample::OpenGLTexture2DMultisample():
11 Texture(GL_TEXTURE_2D_MULTISAMPLE)
13 static Require _req(ARB_texture_multisample);
16 void OpenGLTexture2DMultisample::allocate()
18 unsigned width = static_cast<const Texture2DMultisample *>(this)->width;
19 unsigned height = static_cast<const Texture2DMultisample *>(this)->height;
20 unsigned samples = static_cast<const Texture2DMultisample *>(this)->samples;
22 GLenum gl_fmt = get_gl_pixelformat(storage_fmt);
23 if(ARB_texture_storage_multisample)
25 if(ARB_direct_state_access)
26 glTextureStorage2DMultisample(id, samples, gl_fmt, width, height, false);
30 glTexStorage2DMultisample(target, samples, gl_fmt, width, height, false);
36 glTexImage2DMultisample(target, samples, gl_fmt, width, height, false);