]> git.tdb.fi Git - libs/gl.git/blobdiff - source/core/texture2dmultisample.cpp
Move all OpenGL-specific code to a separate directory
[libs/gl.git] / source / core / texture2dmultisample.cpp
index 782a55694961e55a979ba772c5f28c5e766f5a51..5ea37e90e3d82e81f2674f94691f2051c25f1a69 100644 (file)
@@ -1,6 +1,3 @@
-#include <msp/gl/extensions/arb_direct_state_access.h>
-#include <msp/gl/extensions/arb_texture_multisample.h>
-#include <msp/gl/extensions/arb_texture_storage_multisample.h>
 #include "deviceinfo.h"
 #include "error.h"
 #include "texture2dmultisample.h"
@@ -11,12 +8,9 @@ namespace Msp {
 namespace GL {
 
 Texture2DMultisample::Texture2DMultisample():
-       Texture(GL_TEXTURE_2D_MULTISAMPLE),
        width(0),
        height(0)
-{
-       static Require _req(ARB_texture_multisample);
-}
+{ }
 
 void Texture2DMultisample::storage(PixelFormat fmt, unsigned wd, unsigned ht, unsigned sm)
 {
@@ -36,23 +30,7 @@ void Texture2DMultisample::storage(PixelFormat fmt, unsigned wd, unsigned ht, un
        height = ht;
        samples = sm;
 
-       GLenum gl_fmt = get_gl_pixelformat(storage_fmt);
-       if(ARB_texture_storage_multisample)
-       {
-               if(ARB_direct_state_access)
-                       glTextureStorage2DMultisample(id, samples, gl_fmt, width, height, false);
-               else
-               {
-                       bind_scratch();
-                       glTexStorage2DMultisample(target, samples, gl_fmt, width, height, false);
-               }
-       }
-       else
-       {
-               bind_scratch();
-               glTexImage2DMultisample(target, samples, gl_fmt, width, height, false);
-       }
-       apply_swizzle();
+       allocate();
 }
 
 void Texture2DMultisample::image(const Graphics::Image &, unsigned)