From fbeb7b02bc5d1d9d67c695effafafb9619ed549e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 17 Jan 2013 12:47:56 +0100 Subject: [PATCH] Minor renaming in shader/mesh guts. Function size() will be used later for commputing size of the attribute, renaming the original to components(). --- src/AbstractShaderProgram.h | 28 ++++++++++++++-------------- src/Mesh.h | 6 +++--- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/AbstractShaderProgram.h b/src/AbstractShaderProgram.h index 2c78f8b17..007472f41 100644 --- a/src/AbstractShaderProgram.h +++ b/src/AbstractShaderProgram.h @@ -1093,24 +1093,24 @@ template<> struct Attribute { static const DataType DefaultDataType = DataType::Float; - inline constexpr static GLint size(DataOptions) { return 1; } + inline constexpr static GLint components(DataOptions) { return 1; } inline constexpr static std::size_t vectorCount() { return 1; } }; CORRADE_ENUMSET_OPERATORS(Attribute::DataOptions) template struct Attribute>: public Attribute { - inline constexpr static GLint size(DataOptions) { return vectorSize; } + inline constexpr static GLint components(DataOptions) { return vectorSize; } inline constexpr static std::size_t vectorCount() { return 1; } }; template struct Attribute>: public Attribute { - inline constexpr static GLint size(DataOptions) { return rows; } + inline constexpr static GLint components(DataOptions) { return rows; } inline constexpr static std::size_t vectorCount() { return cols; } }; template struct Attribute>: public Attribute { - inline constexpr static GLint size(DataOptions) { return matrixSize; } + inline constexpr static GLint components(DataOptions) { return matrixSize; } inline constexpr static std::size_t vectorCount() { return matrixSize; } }; @@ -1153,11 +1153,11 @@ template<> struct Attribute> { static const DataType DefaultDataType = DataType::Float; #ifndef MAGNUM_TARGET_GLES - inline constexpr static GLint size(DataOptions options) { + inline constexpr static GLint components(DataOptions options) { return options & DataOption::BGRA ? GL_BGRA : 4; } #else - inline constexpr static GLint size(DataOptions) { return 4; } + inline constexpr static GLint components(DataOptions) { return 4; } #endif inline constexpr static std::size_t vectorCount() { return 1; } @@ -1182,7 +1182,7 @@ template<> struct Attribute { static const DataType DefaultDataType = DataType::Int; - inline constexpr static GLint size() { return 1; } + inline constexpr static GLint components() { return 1; } }; template<> struct Attribute { @@ -1193,15 +1193,15 @@ template<> struct Attribute { static const DataType DefaultDataType = DataType::UnsignedInt; - inline constexpr static GLint size() { return 1; } + inline constexpr static GLint components() { return 1; } }; template struct Attribute>: public Attribute { - inline constexpr static GLint size() { return size; } + inline constexpr static GLint components() { return size; } }; template struct Attribute>: public Attribute { - inline constexpr static GLint size() { return size; } + inline constexpr static GLint components() { return size; } }; #ifndef MAGNUM_TARGET_GLES @@ -1216,22 +1216,22 @@ template<> struct Attribute { static const DataType DefaultDataType = DataType::Double; - inline constexpr static GLint size() { return 1; } + inline constexpr static GLint components() { return 1; } inline constexpr static std::size_t vectorCount() { return 1; } }; template struct Attribute>: public Attribute { - inline constexpr static GLint size() { return rows; } + inline constexpr static GLint components() { return rows; } inline constexpr static std::size_t vectorCount() { return cols; } }; template struct Attribute>: public Attribute { - inline constexpr static GLint size() { return size; } + inline constexpr static GLint components() { return size; } inline constexpr static std::size_t vectorCount() { return size; } }; template struct Attribute>: public Attribute { - inline constexpr static GLint size() { return size; } + inline constexpr static GLint components() { return size; } inline constexpr static std::size_t vectorCount() { return size; } }; #endif diff --git a/src/Mesh.h b/src/Mesh.h index 9d88de758..6c684e661 100644 --- a/src/Mesh.h +++ b/src/Mesh.h @@ -632,7 +632,7 @@ class MAGNUM_EXPORT Mesh { attributes.push_back({ buffer, location+i, - Implementation::Attribute::size(attribute.dataOptions()), + Implementation::Attribute::components(attribute.dataOptions()), static_cast(attribute.dataType()), !!(attribute.dataOptions() & AbstractShaderProgram::Attribute::DataOption::Normalized), offset, @@ -648,7 +648,7 @@ class MAGNUM_EXPORT Mesh { integerAttributes.push_back({ buffer, location, - Implementation::Attribute::size(), + Implementation::Attribute::components(), static_cast(attribute.dataType()), offset, stride @@ -663,7 +663,7 @@ class MAGNUM_EXPORT Mesh { longAttributes.push_back({ buffer, location+i, - Implementation::Attribute::size(), + Implementation::Attribute::components(), static_cast(attribute.dataType()), offset, stride