mirror of
https://github.com/love2d/love.git
synced 2026-08-18 11:44:15 +02:00
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:
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user