mirror of
https://github.com/love2d/love.git
synced 2026-08-13 00:50:51 +02:00
Added Transform objects to love.math (resolves issue #1228).
- Added love.math.newTransform. - Added love.graphics.applyTransform and love.graphics.replaceTransform. - love.graphics.draw/print/printf, Text:add/addf, and SpriteBatch:add can accept a Transform argument. - love.graphics.push can accept an optional Transform as a second argument, which will apply the Transform after pushing the matrix stack, - Shader:send can accept Transform objects when sending to a mat4 uniform variable. --HG-- branch : minor
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
#include "common/int.h"
|
||||
#include "common/StringMap.h"
|
||||
#include "BezierCurve.h"
|
||||
#include "Transform.h"
|
||||
|
||||
// STL
|
||||
#include <cmath>
|
||||
@@ -374,6 +375,16 @@ BezierCurve *Math::newBezierCurve(const std::vector<Vector> &points)
|
||||
return new BezierCurve(points);
|
||||
}
|
||||
|
||||
Transform *Math::newTransform()
|
||||
{
|
||||
return new Transform();
|
||||
}
|
||||
|
||||
Transform *Math::newTransform(float x, float y, float a, float sx, float sy, float ox, float oy, float kx, float ky)
|
||||
{
|
||||
return new Transform(x, y, a, sx, sy, ox, oy, kx, ky);
|
||||
}
|
||||
|
||||
std::string hash(HashFunction::Function function, Data *input)
|
||||
{
|
||||
return hash(function, (const char*) input->getData(), input->getSize());
|
||||
|
||||
Reference in New Issue
Block a user