[shader] GL types for all Shader attributes

This commit is contained in:
Bruno de Oliveira Abinader
2015-09-10 17:45:02 +03:00
committed by Konstantin Käfer
parent 1f1b3fbbc2
commit b2fcde5e8b
16 changed files with 125 additions and 125 deletions

View File

@@ -3,42 +3,42 @@
namespace mbgl {
template <>
void Uniform<float>::bind(const float& t) {
void Uniform<GLfloat>::bind(const GLfloat& t) {
MBGL_CHECK_ERROR(glUniform1f(location, t));
}
template <>
void Uniform<int32_t>::bind(const int32_t& t) {
void Uniform<GLint>::bind(const GLint& t) {
MBGL_CHECK_ERROR(glUniform1i(location, t));
}
template <>
void Uniform<std::array<float, 2>>::bind(const std::array<float, 2>& t) {
void Uniform<std::array<GLfloat, 2>>::bind(const std::array<GLfloat, 2>& t) {
MBGL_CHECK_ERROR(glUniform2fv(location, 1, t.data()));
}
template <>
void Uniform<std::array<float, 3>>::bind(const std::array<float, 3>& t) {
void Uniform<std::array<GLfloat, 3>>::bind(const std::array<GLfloat, 3>& t) {
MBGL_CHECK_ERROR(glUniform3fv(location, 1, t.data()));
}
template <>
void Uniform<std::array<float, 4>>::bind(const std::array<float, 4>& t) {
void Uniform<std::array<GLfloat, 4>>::bind(const std::array<GLfloat, 4>& t) {
MBGL_CHECK_ERROR(glUniform4fv(location, 1, t.data()));
}
template <>
void UniformMatrix<2>::bind(const std::array<float, 4>& t) {
void UniformMatrix<2>::bind(const std::array<GLfloat, 4>& t) {
MBGL_CHECK_ERROR(glUniformMatrix2fv(location, 1, GL_FALSE, t.data()));
}
template <>
void UniformMatrix<3>::bind(const std::array<float, 9>& t) {
void UniformMatrix<3>::bind(const std::array<GLfloat, 9>& t) {
MBGL_CHECK_ERROR(glUniformMatrix3fv(location, 1, GL_FALSE, t.data()));
}
template <>
void UniformMatrix<4>::bind(const std::array<float, 16>& t) {
void UniformMatrix<4>::bind(const std::array<GLfloat, 16>& t) {
MBGL_CHECK_ERROR(glUniformMatrix4fv(location, 1, GL_FALSE, t.data()));
}