]> git.tdb.fi Git - libs/gl.git/commitdiff
Move extension requirements from ProgramData to UniformBlock
authorMikko Rasa <tdb@tdb.fi>
Mon, 16 Jun 2014 21:02:03 +0000 (00:02 +0300)
committerMikko Rasa <tdb@tdb.fi>
Mon, 16 Jun 2014 21:02:03 +0000 (00:02 +0300)
ProgramData no longer manipulates GL directly, and it's used in places
like Renderer and Material.  This changes allows those things to be used
without shader support.

source/programdata.cpp
source/uniformblock.cpp

index 1287914005055ff91bb2102260daf4b28d50e710..bdbe4c1d9e4427721e73096a7b74570e73d26786 100644 (file)
@@ -1,4 +1,3 @@
-#include <msp/gl/extensions/arb_shader_objects.h>
 #include "buffer.h"
 #include "color.h"
 #include "error.h"
@@ -18,9 +17,7 @@ ProgramData::ProgramData():
        last_block(0),
        buffer(0),
        changes(NO_CHANGES)
-{
-       static Require _req(ARB_shader_objects);
-}
+{ }
 
 // Blocks are intentionally left uncopied
 ProgramData::ProgramData(const ProgramData &other):
index 6b9de26931995e46446ef52e4dd57c81a3381ca0..498973f91de39dccf64512a00e0eceb1b3b2d63b 100644 (file)
@@ -1,4 +1,6 @@
 #include <stdexcept>
+#include <msp/gl/extensions/arb_shader_objects.h>
+#include <msp/gl/extensions/arb_uniform_buffer_object.h>
 #include "buffer.h"
 #include "color.h"
 #include "error.h"
@@ -14,13 +16,17 @@ namespace GL {
 
 UniformBlock::UniformBlock():
        buf_range(0)
-{ }
+{
+       static Require _req(ARB_shader_objects);
+}
 
 UniformBlock::UniformBlock(unsigned s):
        size(s),
        data(size),
        buf_range(0)
-{ }
+{
+       static Require _req(ARB_uniform_buffer_object);
+}
 
 UniformBlock::~UniformBlock()
 {