X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Funiform.cpp;h=b183719fe339debaf55402b35cb2eeda15bb3d8a;hp=09450a9a0962f991805ae0d7ba35698ff031f515;hb=49f1812b3e5ad73748015df52d0e4dee17246036;hpb=6afbace895a7bbcf216ab8e48280ea0303ab5892 diff --git a/source/uniform.cpp b/source/uniform.cpp index 09450a9a..b183719f 100644 --- a/source/uniform.cpp +++ b/source/uniform.cpp @@ -1,4 +1,4 @@ -#include "arb_shader_objects.h" +#include #include "uniform.h" namespace Msp { @@ -17,18 +17,36 @@ void UniformScalar::apply(int index, unsigned size, const float *value) } +template<> +void UniformVector::apply(int index, unsigned size, const int *value) +{ + glUniform2iv(index, size, value); +} + template<> void UniformVector::apply(int index, unsigned size, const float *value) { glUniform2fv(index, size, value); } +template<> +void UniformVector::apply(int index, unsigned size, const int *value) +{ + glUniform3iv(index, size, value); +} + template<> void UniformVector::apply(int index, unsigned size, const float *value) { glUniform3fv(index, size, value); } +template<> +void UniformVector::apply(int index, unsigned size, const int *value) +{ + glUniform4iv(index, size, value); +} + template<> void UniformVector::apply(int index, unsigned size, const float *value) { @@ -36,6 +54,18 @@ void UniformVector::apply(int index, unsigned size, const float *value } +template<> +void UniformMatrix::apply(int index, unsigned size, const float *value) +{ + glUniformMatrix2fv(index, size, false, value); +} + +template<> +void UniformMatrix::apply(int index, unsigned size, const float *value) +{ + glUniformMatrix3fv(index, size, false, value); +} + template<> void UniformMatrix::apply(int index, unsigned size, const float *value) {