aboutsummaryrefslogtreecommitdiffstats
path: root/src/menu/container.cpp
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2012-09-05 18:33:58 +0200
committerAlexander Sulfrian <alexander@sulfrian.net>2013-01-13 22:40:53 +0100
commit8405e8fb43392e7d0f9c77863e5789df05ec1df6 (patch)
treec10dee2039b66ccb18c242adf2e2e90a47f71528 /src/menu/container.cpp
parent9c34d27a8bc724722e9cae203e0c455573c3d5f1 (diff)
downloadusdx-8405e8fb43392e7d0f9c77863e5789df05ec1df6.tar.gz
usdx-8405e8fb43392e7d0f9c77863e5789df05ec1df6.tar.xz
usdx-8405e8fb43392e7d0f9c77863e5789df05ec1df6.zip
menu/modelview_matrix_cache: add helper class
Use the new ModelviewMatrixCache to cache the current state of the opengl MODELVIEW_MATRIX.
Diffstat (limited to '')
-rw-r--r--src/menu/container.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/menu/container.cpp b/src/menu/container.cpp
index d4808ee3..d225ef1e 100644
--- a/src/menu/container.cpp
+++ b/src/menu/container.cpp
@@ -22,10 +22,9 @@
*
*/
-#include <GL/gl.h>
-
#include "container.hpp"
#include "frame.hpp"
+#include "modelview_matrix_cache.hpp"
namespace usdx
{
@@ -62,13 +61,11 @@ namespace usdx
frame->repaint();
}
- GLfloat matrix[16];
- glGetFloatv(GL_MODELVIEW_MATRIX, matrix);
-
+ ModelviewMatrixCache c;
for (std::list<DrawableControl*>::iterator it =
controls.begin(); it != controls.end(); it++) {
(*it)->repaint();
- glLoadMatrixf(matrix);
+ c.restore();
}
}