Browse Source

Use UnsignedInt instead of std::size_t for attribute sizes/offsets.

pull/51/head
Vladimír Vondruš 12 years ago
parent
commit
6ce7466b21
  1. 8
      src/Magnum/AbstractShaderProgram.cpp
  2. 10
      src/Magnum/AbstractShaderProgram.h

8
src/Magnum/AbstractShaderProgram.cpp

@ -806,7 +806,7 @@ void AbstractShaderProgram::uniformImplementationDSA(const GLint location, const
namespace Implementation {
std::size_t FloatAttribute::size(GLint components, DataType dataType) {
UnsignedInt FloatAttribute::size(GLint components, DataType dataType) {
switch(dataType) {
case DataType::UnsignedByte:
case DataType::Byte:
@ -829,7 +829,7 @@ std::size_t FloatAttribute::size(GLint components, DataType dataType) {
}
#ifndef MAGNUM_TARGET_GLES2
std::size_t IntAttribute::size(GLint components, DataType dataType) {
UnsignedInt IntAttribute::size(GLint components, DataType dataType) {
switch(dataType) {
case DataType::UnsignedByte:
case DataType::Byte:
@ -847,7 +847,7 @@ std::size_t IntAttribute::size(GLint components, DataType dataType) {
#endif
#ifndef MAGNUM_TARGET_GLES
std::size_t DoubleAttribute::size(GLint components, DataType dataType) {
UnsignedInt DoubleAttribute::size(GLint components, DataType dataType) {
switch(dataType) {
case DataType::Double:
return 8*components;
@ -857,7 +857,7 @@ std::size_t DoubleAttribute::size(GLint components, DataType dataType) {
}
#endif
std::size_t Attribute<Math::Vector<4, Float>>::size(GLint components, DataType dataType) {
UnsignedInt Attribute<Math::Vector<4, Float>>::size(GLint components, DataType dataType) {
#ifndef MAGNUM_TARGET_GLES
if(components == GL_BGRA) components = 4;
#endif

10
src/Magnum/AbstractShaderProgram.h

@ -1195,7 +1195,7 @@ struct FloatAttribute {
};
typedef Containers::EnumSet<DataOption, UnsignedByte> DataOptions;
static std::size_t MAGNUM_EXPORT size(GLint components, DataType dataType);
static UnsignedInt MAGNUM_EXPORT size(GLint components, DataType dataType);
};
CORRADE_ENUMSET_OPERATORS(FloatAttribute::DataOptions)
@ -1220,7 +1220,7 @@ struct IntAttribute {
enum class DataOption: UnsignedByte {};
typedef Containers::EnumSet<DataOption, UnsignedByte> DataOptions;
static std::size_t MAGNUM_EXPORT size(GLint components, DataType dataType);
static UnsignedInt MAGNUM_EXPORT size(GLint components, DataType dataType);
};
Debug MAGNUM_EXPORT operator<<(Debug debug, IntAttribute::DataType value);
@ -1235,7 +1235,7 @@ struct UnsignedIntAttribute {
typedef IntAttribute::DataOption DataOption;
typedef Containers::EnumSet<DataOption, UnsignedByte> DataOptions;
static std::size_t size(GLint components, DataType dataType) {
static UnsignedInt size(GLint components, DataType dataType) {
return IntAttribute::size(components, dataType);
}
};
@ -1254,7 +1254,7 @@ struct DoubleAttribute {
enum class DataOption: UnsignedByte {};
typedef Containers::EnumSet<DataOption, UnsignedByte> DataOptions;
static std::size_t MAGNUM_EXPORT size(GLint components, DataType dataType);
static UnsignedInt MAGNUM_EXPORT size(GLint components, DataType dataType);
};
Debug MAGNUM_EXPORT operator<<(Debug debug, DoubleAttribute::DataType value);
@ -1308,7 +1308,7 @@ template<> struct Attribute<Math::Vector<4, Float>> {
enum: UnsignedInt { VectorCount = 1 };
static std::size_t MAGNUM_EXPORT size(GLint components, DataType dataType);
static UnsignedInt MAGNUM_EXPORT size(GLint components, DataType dataType);
};
typedef Math::Vector<4, Float> _Vector4;

Loading…
Cancel
Save