Shader:send now optionally accepts a Data object (with optional byte offset and size parameters). Resolves issue #1343.

Also changed the optional 'columnMajor' argument of the matrix variant of Shader:send and Transform:setMatrix to accept enum constants instead. Valid values are "row" and "column".

--HG--
branch : minor
This commit is contained in:
Alex Szpakowski
2017-09-23 19:47:57 -03:00
parent 77663ed847
commit 5f64737956
6 changed files with 178 additions and 26 deletions
+14
View File
@@ -24,6 +24,7 @@
#include "common/Object.h"
#include "common/Matrix.h"
#include "common/Vector.h"
#include "common/StringMap.h"
namespace love
{
@@ -34,6 +35,13 @@ class Transform : public Object
{
public:
enum MatrixLayout
{
MATRIX_ROW_MAJOR,
MATRIX_COLUMN_MAJOR,
MATRIX_MAX_ENUM
};
static love::Type type;
Transform();
@@ -61,6 +69,9 @@ public:
const Matrix4 &getMatrix() const;
void setMatrix(const Matrix4 &m);
static bool getConstant(const char *in, MatrixLayout &out);
static bool getConstant(MatrixLayout in, const char *&out);
private:
inline const Matrix4 &getInverseMatrix()
@@ -78,6 +89,9 @@ private:
bool inverseDirty;
Matrix4 inverseMatrix;
static StringMap<MatrixLayout, MATRIX_MAX_ENUM>::Entry matrixLayoutEntries[];
static StringMap<MatrixLayout, MATRIX_MAX_ENUM> matrixLayouts;
}; // Transform