]> git.tdb.fi Git - libs/gl.git/blobdiff - source/core/renderbuffer.cpp
Store implementation limits in a central struct
[libs/gl.git] / source / core / renderbuffer.cpp
index 9af18daec9f1082ccd54c6e432e33a77478e9ed7..57b43eba7aaf6dcabc8b8899efff8310e66c11ac 100644 (file)
@@ -2,7 +2,7 @@
 #include <msp/gl/extensions/ext_framebuffer_multisample.h>
 #include <msp/gl/extensions/ext_framebuffer_object.h>
 #include <msp/gl/extensions/khr_debug.h>
-#include "misc.h"
+#include "deviceinfo.h"
 #include "renderbuffer.h"
 
 using namespace std;
@@ -41,8 +41,7 @@ void Renderbuffer::storage(PixelFormat fmt, unsigned wd, unsigned ht)
 
 unsigned Renderbuffer::get_max_samples()
 {
-       static unsigned max_samples = (EXT_framebuffer_multisample ? get_i(GL_MAX_SAMPLES) : 0);
-       return max_samples;
+       return Limits::get_global().max_samples;
 }
 
 void Renderbuffer::storage_multisample(unsigned samples, PixelFormat fmt, unsigned wd, unsigned ht)
@@ -51,7 +50,7 @@ void Renderbuffer::storage_multisample(unsigned samples, PixelFormat fmt, unsign
                return storage(fmt, wd, ht);
 
        static Require _req(EXT_framebuffer_multisample);
-       if(samples>get_max_samples())
+       if(samples>Limits::get_global().max_samples)
                throw out_of_range("Renderbuffer::storage_multisample");
 
        require_pixelformat(fmt);