13 #include "system_gl.h" 22 constexpr
CMatrixGL(GLfloat x0, GLfloat x1, GLfloat x2, GLfloat x3,
23 GLfloat x4, GLfloat x5, GLfloat x6, GLfloat x7,
24 GLfloat x8, GLfloat x9, GLfloat x10, GLfloat x11,
25 GLfloat x12, GLfloat x13, GLfloat x14, GLfloat x15)
26 :m_pMatrix{x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15} {}
30 operator const float*()
const {
return m_pMatrix; }
33 void Ortho(GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f);
34 void Ortho2D(GLfloat l, GLfloat r, GLfloat b, GLfloat t);
35 void Frustum(GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f);
36 void Translatef(GLfloat x, GLfloat y, GLfloat z);
37 void Scalef(GLfloat x, GLfloat y, GLfloat z);
38 void Rotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
39 void MultMatrixf(
const CMatrixGL &matrix) noexcept;
40 void LookAt(GLfloat eyex, GLfloat eyey, GLfloat eyez, GLfloat centerx, GLfloat centery, GLfloat centerz, GLfloat upx, GLfloat upy, GLfloat upz);
42 static bool Project(GLfloat objx, GLfloat objy, GLfloat objz,
const GLfloat modelMatrix[16],
const GLfloat projMatrix[16],
const GLint viewport[4], GLfloat* winx, GLfloat* winy, GLfloat* winz);
47 alignas(16) GLfloat m_pMatrix[16];
55 m_stack.push(m_current);
60 m_stack = std::stack<CMatrixGL>();
67 m_current = m_stack.top();
73 void PopLoad() { Pop(); Load(); }
76 CMatrixGL* operator->() {
return &m_current; }
79 std::stack<CMatrixGL> m_stack;
Definition: MatrixGL.h:17
Definition: MatrixGL.h:50