OGLplus (0.52.0) a C++ wrapper for OpenGL

matrix.hpp
1 
12 #pragma once
13 #ifndef OGLPLUS_EXT_DSA_MATRIX_1107121519_HPP
14 #define OGLPLUS_EXT_DSA_MATRIX_1107121519_HPP
15 
16 #include <oglplus/fwd.hpp>
18 
19 namespace oglplus {
20 
21 #if OGLPLUS_DOCUMENTATION_ONLY || GL_EXT_direct_state_access
22 
24 
28 {
29 private:
31 public:
34 
37  : _mode(mode)
38  { }
39 
41 
46  {
47  OGLPLUS_GLFUNC(MatrixPushEXT)(GLenum(_mode));
48  OGLPLUS_VERIFY_SIMPLE(MatrixPushEXT);
49  return *this;
50  }
51 
53 
58  {
59  OGLPLUS_GLFUNC(MatrixPopEXT)(GLenum(_mode));
60  OGLPLUS_VERIFY_SIMPLE(MatrixPopEXT);
61  return *this;
62  }
63 
65 
70  {
71  OGLPLUS_GLFUNC(MatrixLoadIdentityEXT)(GLenum(_mode));
72  OGLPLUS_VERIFY_SIMPLE(MatrixLoadIdentityEXT);
73  return *this;
74  }
75 
77 
82  {
83  OGLPLUS_GLFUNC(MatrixLoadTransposefEXT)(
84  GLenum(_mode),
85  Data(matrix)
86  );
87  OGLPLUS_VERIFY_SIMPLE(MatrixLoadTransposefEXT);
88  return *this;
89  }
90 
92 
97  {
98  OGLPLUS_GLFUNC(MatrixLoadTransposedEXT)(
99  GLenum(_mode),
100  Data(matrix)
101  );
102  OGLPLUS_VERIFY_SIMPLE(MatrixLoadTransposedEXT);
103  return *this;
104  }
105 
107 
112  {
113  OGLPLUS_GLFUNC(MatrixMultTransposefEXT)(
114  GLenum(_mode),
115  Data(matrix)
116  );
117  OGLPLUS_VERIFY_SIMPLE(MatrixMultTransposefEXT);
118  return *this;
119  }
120 
122 
127  {
128  OGLPLUS_GLFUNC(MatrixMultTransposedEXT)(
129  GLenum(_mode),
130  Data(matrix)
131  );
132  OGLPLUS_VERIFY_SIMPLE(MatrixMultTransposedEXT);
133  return *this;
134  }
135 
137 
142  Angle<GLfloat> angle,
143  const GLfloat x,
144  const GLfloat y,
145  const GLfloat z
146  )
147  {
148  OGLPLUS_GLFUNC(MatrixRotatefEXT)(
149  GLenum(_mode),
150  Degrees(angle),
151  x, y, z
152  );
153  OGLPLUS_VERIFY_SIMPLE(MatrixRotatefEXT);
154  return *this;
155  }
156 
158 
163  Angle<GLfloat> angle,
164  const Vector<GLfloat, 3>& axis
165  )
166  {
167  OGLPLUS_GLFUNC(MatrixRotatefEXT)(
168  GLenum(_mode),
169  Degrees(angle),
170  At(axis, 0),
171  At(axis, 1),
172  At(axis, 2)
173  );
174  OGLPLUS_VERIFY_SIMPLE(MatrixRotatefEXT);
175  return *this;
176  }
177 
179 
184  Angle<GLdouble> angle,
185  const Vector<GLdouble, 3>& axis
186  )
187  {
188  OGLPLUS_GLFUNC(MatrixRotatedEXT)(
189  GLenum(_mode),
190  Degrees(angle),
191  At(axis, 0),
192  At(axis, 1),
193  At(axis, 2)
194  );
195  OGLPLUS_VERIFY_SIMPLE(MatrixRotatedEXT);
196  return *this;
197  }
198 
200 
204  DSAMatrixEXT& Scale(const GLfloat x, const GLfloat y, const GLfloat z)
205  {
206  OGLPLUS_GLFUNC(MatrixScalefEXT)(GLenum(_mode), x, y, z);
207  OGLPLUS_VERIFY_SIMPLE(MatrixScalefEXT);
208  return *this;
209  }
210 
212 
217  {
218  OGLPLUS_GLFUNC(MatrixScalefEXT)(
219  GLenum(_mode),
220  At(amount, 0),
221  At(amount, 1),
222  At(amount, 2)
223  );
224  OGLPLUS_VERIFY_SIMPLE(MatrixScalefEXT);
225  return *this;
226  }
227 
229 
234  {
235  OGLPLUS_GLFUNC(MatrixScalefEXT)(
236  GLenum(_mode),
237  At(amount, 0),
238  At(amount, 1),
239  At(amount, 2)
240  );
241  OGLPLUS_VERIFY_SIMPLE(MatrixScaledEXT);
242  return *this;
243  }
244 
246 
251  const GLfloat x,
252  const GLfloat y,
253  const GLfloat z
254  )
255  {
256  OGLPLUS_GLFUNC(MatrixTranslatefEXT)(GLenum(_mode), x, y, z);
257  OGLPLUS_VERIFY_SIMPLE(MatrixTranslatefEXT);
258  return *this;
259  }
260 
262 
267  {
268  OGLPLUS_GLFUNC(MatrixTranslatefEXT)(
269  GLenum(_mode),
270  At(amount, 0),
271  At(amount, 1),
272  At(amount, 2)
273  );
274  OGLPLUS_VERIFY_SIMPLE(MatrixTranslatefEXT);
275  return *this;
276  }
277 
279 
284  {
285  OGLPLUS_GLFUNC(MatrixTranslatefEXT)(
286  GLenum(_mode),
287  At(amount, 0),
288  At(amount, 1),
289  At(amount, 2)
290  );
291  OGLPLUS_VERIFY_SIMPLE(MatrixTranslatedEXT);
292  return *this;
293  }
294 
296 
301  GLdouble left,
302  GLdouble right,
303  GLdouble bottom,
304  GLdouble top,
305  GLdouble near_depth,
306  GLdouble far_depth
307  )
308  {
309  OGLPLUS_GLFUNC(MatrixOrthoEXT)(
310  GLenum(_mode),
311  left,
312  right,
313  bottom,
314  top,
315  near_depth,
316  far_depth
317  );
318  OGLPLUS_VERIFY_SIMPLE(MatrixOrthoEXT);
319  return *this;
320  }
321 
323 
328  GLdouble left,
329  GLdouble right,
330  GLdouble bottom,
331  GLdouble top,
332  GLdouble near_depth,
333  GLdouble far_depth
334  )
335  {
336  OGLPLUS_GLFUNC(MatrixFrustumEXT)(
337  GLenum(_mode),
338  left,
339  right,
340  bottom,
341  top,
342  near_depth,
343  far_depth
344  );
345  OGLPLUS_VERIFY_SIMPLE(MatrixFrustumEXT);
346  return *this;
347  }
348 };
349 
352  : public DSAMatrixEXT
353 {
354 public:
357  { }
358 };
359 
362  : public DSAMatrixEXT
363 {
364 public:
367  { }
368 };
369 
370 #endif // GL_EXT_direct_state_access
371 
372 } // namespace oglplus
373 
374 #endif // include guard
DSAMatrixEXT & Rotate(Angle< GLfloat > angle, const Vector< GLfloat, 3 > &axis)
Applies rotation by angle around axis to the current matrix.
Definition: matrix.hpp:162
DSAMatrixEXT & Scale(const Vector< GLdouble, 3 > &amount)
Scales the current matrix.
Definition: matrix.hpp:233
Class implementing planar angle-related functionality.
Definition: fwd.hpp:24
DSAMatrixEXT(Mode mode)
Constructs a new compatibility DSA matrix.
Definition: matrix.hpp:36
DSAMatrixEXT & Ortho(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near_depth, GLdouble far_depth)
Makes an ortho-matrix from the current matrix.
Definition: matrix.hpp:300
CompatibilityMatrixMode Mode
The matrix mode enumeration.
Definition: matrix.hpp:33
DSAMatrixEXT & LoadIdentity(void)
Loads an identity matrix.
Definition: matrix.hpp:69
DSAMatrixEXT & Mult(const Matrix< GLfloat, 4, 4 > &matrix)
Multiplies the current matrix by the specified matrix.
Definition: matrix.hpp:111
DSAMatrixEXT & Translate(const GLfloat x, const GLfloat y, const GLfloat z)
Translates the current matrix.
Definition: matrix.hpp:250
DSAMatrixEXT & Pop(void)
Pops a matrix from the stack.
Definition: matrix.hpp:57
DSAMatrixEXT & Mult(const Matrix< GLdouble, 4, 4 > &matrix)
Multiplies the current matrix by the specified matrix.
Definition: matrix.hpp:126
Forward declarations.
DSAMatrixEXT & Translate(const Vector< GLfloat, 3 > &amount)
Translates the current matrix.
Definition: matrix.hpp:266
DSAMatrixEXT & Rotate(Angle< GLfloat > angle, const GLfloat x, const GLfloat y, const GLfloat z)
Applies rotation by angle around axis <x,y,z> to the current matrix.
Definition: matrix.hpp:141
DSAMatrixEXT & Load(const Matrix< GLdouble, 4, 4 > &matrix)
Loads the specified matrix.
Definition: matrix.hpp:96
DSAMatrixEXT & Frustum(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near_depth, GLdouble far_depth)
Makes a frustum-matrix from the current matrix.
Definition: matrix.hpp:327
DSAMatrixEXT & Scale(const GLfloat x, const GLfloat y, const GLfloat z)
Scales the current matrix.
Definition: matrix.hpp:204
CompatibilityMatrixMode
Compatibility matrix mode enumeration.
Definition: matrix_mode.hpp:28
DSAMatrixEXT & Translate(const Vector< GLdouble, 3 > &amount)
Translates the current matrix.
Definition: matrix.hpp:283
DSAMatrixEXT & Push(void)
Pushes a matrix on the stack.
Definition: matrix.hpp:45
DSAMatrixEXT & Scale(const Vector< GLfloat, 3 > &amount)
Scales the current matrix.
Definition: matrix.hpp:216
Wrapper for direct-state-access compatibility matrix operations.
Definition: matrix.hpp:27
DSAMatrixEXT & Load(const Matrix< GLfloat, 4, 4 > &matrix)
Loads the specified matrix.
Definition: matrix.hpp:81
The CompatibilityMatrixMode enumeration.
DSAMatrixEXT & Rotate(Angle< GLdouble > angle, const Vector< GLdouble, 3 > &axis)
Applies rotation by angle around axis to the current matrix.
Definition: matrix.hpp:183
Wrapper for direct-state-access compatibility projection matrix operations.
Definition: matrix.hpp:361
Wrapper for direct-state-access compatibility modelview matrix operations.
Definition: matrix.hpp:351

Copyright © 2010-2014 Matúš Chochlík, University of Žilina, Žilina, Slovakia.
<matus.chochlik -at- fri.uniza.sk>
<chochlik -at -gmail.com>
Documentation generated on Mon Sep 22 2014 by Doxygen (version 1.8.6).