JNGL
Easy to use cross-platform 2D game library
Loading...
Searching...
No Matches
matrix.hpp
Go to the documentation of this file.
1// Copyright 2012-2022 Jan Niklas Hasse <jhasse@bixense.com>
2// For conditions of distribution and use, see copyright notice in LICENSE.txt
5#pragma once
6
7#include "Mat3.hpp"
8
9namespace jngl {
10
33
36[[deprecated("use jngl::modelview().rotate instead")]]
37void rotate(double degree);
38
40void translate(double x, double y);
41
45template <class Vect> void translate(Vect v) {
46 translate(v.x, v.y);
47}
48
52void scale(double factor);
53
55void scale(double xfactor, double yfactor);
56
59
61void popMatrix();
62
64void reset();
65
66} // namespace jngl
Contains jngl::Mat3 class.
3x3 matrix
Definition Mat3.hpp:18
JNGL's main namespace.
void rotate(double degree)
Multiplies the global ModelView matrix with a rotation matrix.
void scale(double factor)
Multiplies the global ModelView matrix by a scaling matrix.
void popMatrix()
Replaces the current ModelView matrix with the top element of the global stack.
jngl::Mat3 modelview()
Returns a copy of the global ModelView matrix.
void reset()
Resets the global ModelView matrix to the identity matrix.
void translate(double x, double y)
Multiplies the global ModelView matrix with a translation matrix.
void pushMatrix()
Pushes the current ModelView matrix on a global stack.