3 * Copyright (C) 2005-2013 Team XBMC
6 * This Program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2, or (at your option)
11 * This Program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with XBMC; see the file COPYING. If not, see
18 * <http://www.gnu.org/licenses/>.
30 MM_MATRIXSIZE // Must be last! used for size of matrices
39 GLfloat* GetMatrix(EMATRIXMODE mode);
41 void MatrixMode(EMATRIXMODE mode);
45 void Ortho(GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f);
46 void Ortho2D(GLfloat l, GLfloat r, GLfloat b, GLfloat t);
47 void Frustum(GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f);
48 void Translatef(GLfloat x, GLfloat y, GLfloat z);
49 void Scalef(GLfloat x, GLfloat y, GLfloat z);
50 void Rotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
51 void MultMatrixf(const GLfloat *matrix);
52 void LookAt(GLfloat eyex, GLfloat eyey, GLfloat eyez, GLfloat centerx, GLfloat centery, GLfloat centerz, GLfloat upx, GLfloat upy, GLfloat upz);
53 void PrintMatrix(void);
54 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);
60 MatrixWrapper(){ memset(&m_values, 0, sizeof(m_values)); };
61 MatrixWrapper( const float values[16]) { memcpy(m_values,values,sizeof(m_values)); }
62 MatrixWrapper( const MatrixWrapper &rhs ) { memcpy(m_values, rhs.m_values, sizeof(m_values)); }
63 MatrixWrapper &operator=( const MatrixWrapper &rhs ) { memcpy(m_values, rhs.m_values, sizeof(m_values)); return *this;}
64 operator float*() { return m_values; }
65 operator const float*() const { return m_values; }
70 std::vector<struct MatrixWrapper> m_matrices[(int)MM_MATRIXSIZE];
72 EMATRIXMODE m_matrixMode;
73 #if defined(__ARM_NEON__)
78 extern CMatrixGLES g_matrices;