From 9b2e1d2c6fe27574f10016b154dddad4f511996d Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Tue, 17 Jun 2014 00:02:03 +0300 Subject: [PATCH] Move extension requirements from ProgramData to UniformBlock 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 | 5 +---- source/uniformblock.cpp | 10 ++++++++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/source/programdata.cpp b/source/programdata.cpp index 12879140..bdbe4c1d 100644 --- a/source/programdata.cpp +++ b/source/programdata.cpp @@ -1,4 +1,3 @@ -#include #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): diff --git a/source/uniformblock.cpp b/source/uniformblock.cpp index 6b9de269..498973f9 100644 --- a/source/uniformblock.cpp +++ b/source/uniformblock.cpp @@ -1,4 +1,6 @@ #include +#include +#include #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() { -- 2.43.0