1 // This file belongs to the "MiniCore" game engine. 2 // Copyright (C) 2012 Jussi Lind <jussi.lind@iki.fi> 3 // 4 // This program is free software; you can redistribute it and/or 5 // modify it under the terms of the GNU General Public License 6 // as published by the Free Software Foundation; either version 2 7 // of the License, or (at your option) any later version. 8 // 9 // This program is distributed in the hope that it will be useful, 10 // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 // GNU General Public License for more details. 13 // 14 // You should have received a copy of the GNU General Public License 15 // along with this program; if not, write to the Free Software 16 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 17 // MA 02110-1301, USA. 18 // 19 20 #ifndef MCGLVERTEX_HPP 21 #define MCGLVERTEX_HPP 22 23 #include <MCGLEW> 24 25 class MCGLVertex 26 { 27 public: MCGLVertex(GLfloat x,GLfloat y,GLfloat z)28 MCGLVertex(GLfloat x, GLfloat y, GLfloat z) 29 : m_x(x) 30 , m_y(y) 31 , m_z(z) 32 { 33 } 34 MCGLVertex(GLfloat x,GLfloat y)35 MCGLVertex(GLfloat x, GLfloat y) 36 : m_x(x) 37 , m_y(y) 38 , m_z(0) 39 { 40 } 41 MCGLVertex(GLfloat x)42 MCGLVertex(GLfloat x) 43 : m_x(x) 44 , m_y(0) 45 , m_z(0) 46 { 47 } 48 MCGLVertex()49 MCGLVertex() 50 : m_x(0) 51 , m_y(0) 52 , m_z(0) 53 { 54 } 55 x() const56 inline GLfloat x() const 57 { 58 return m_x; 59 } 60 y() const61 inline GLfloat y() const 62 { 63 return m_y; 64 } 65 z() const66 inline GLfloat z() const 67 { 68 return m_z; 69 } 70 setX(GLfloat x)71 inline void setX(GLfloat x) 72 { 73 m_x = x; 74 } 75 setY(GLfloat y)76 inline void setY(GLfloat y) 77 { 78 m_y = y; 79 } 80 setZ(GLfloat z)81 inline void setZ(GLfloat z) 82 { 83 m_z = z; 84 } 85 86 private: 87 GLfloat m_x, m_y, m_z; 88 }; 89 90 #endif // MCGLVERTEX_HPP 91