]> git.tdb.fi Git - libs/gl.git/blobdiff - source/matrix.cpp
Remove deprecated matrix APIs
[libs/gl.git] / source / matrix.cpp
index 549fe8b61578ecf94958e2650519aea7579a8e00..6ff3b603002f3a43a59cee50f3a4d75508efdae2 100644 (file)
@@ -278,12 +278,14 @@ GLenum MatrixStack::current_mode = GL_MODELVIEW;
 MatrixStack::MatrixStack(GLenum m):
        mode(m)
 {
+       matrices.reserve(mode==GL_MODELVIEW ? 32 : 4);
        matrices.push_back(Matrix());
 }
 
 MatrixStack::MatrixStack():
        mode(0)
 {
+       matrices.reserve(32);
        matrices.push_back(Matrix());
 }
 
@@ -356,75 +358,5 @@ MatrixStack &MatrixStack::projection()
        return ms;
 }
 
-
-// Deprecated stuff
-
-MatrixStack *active_stack = &MatrixStack::modelview();
-
-void matrix_mode(MatrixMode m)
-{
-       if(m==MODELVIEW)
-               active_stack = &MatrixStack::modelview();
-       else if(m==PROJECTION)
-               active_stack = &MatrixStack::projection();
-       else
-               throw invalid_argument("matrix_mode");
-}
-
-void load_identity()
-{
-       *active_stack = Matrix();
-}
-
-void load_matrix(const float *matrix)
-{
-       *active_stack = Matrix(matrix);
-}
-
-void load_matrix(const double *matrix)
-{
-       *active_stack = Matrix(matrix);
-}
-
-void mult_matrix(const float *matrix)
-{
-       *active_stack *= Matrix(matrix);
-}
-
-void mult_matrix(const double *matrix)
-{
-       *active_stack *= Matrix(matrix);
-}
-
-void push_matrix()
-{
-       active_stack->push();
-}
-
-void pop_matrix()
-{
-       active_stack->pop();
-}
-
-void translate(float x, float y, float z)
-{
-       *active_stack *= Matrix::translation(x, y, z);
-}
-
-void rotate(float a, float x, float y, float z)
-{
-       *active_stack *= Matrix::rotation_deg(a, x, y, z);
-}
-
-void scale(float x, float y, float z)
-{
-       *active_stack *= Matrix::scaling(x, y, z);
-}
-
-void scale_uniform(float s)
-{
-       *active_stack *= Matrix::scaling(s);
-}
-
 } // namespace GL
 } // namespace Msp