From 8405e8fb43392e7d0f9c77863e5789df05ec1df6 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Wed, 5 Sep 2012 18:33:58 +0200 Subject: menu/modelview_matrix_cache: add helper class Use the new ModelviewMatrixCache to cache the current state of the opengl MODELVIEW_MATRIX. --- src/menu/container.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/menu/container.cpp') 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 - #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::iterator it = controls.begin(); it != controls.end(); it++) { (*it)->repaint(); - glLoadMatrixf(matrix); + c.restore(); } } -- cgit v1.2.3