From 7ff979d1c6c840993abb788f41a7ed95c231dae3 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Thu, 17 Jan 2013 15:42:02 +0200 Subject: [PATCH] Use GL::Renderer in TrackWrap --- source/designer/trackwrap.cpp | 11 ++++++----- source/designer/trackwrap.h | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/source/designer/trackwrap.cpp b/source/designer/trackwrap.cpp index 1f620f3..523c967 100644 --- a/source/designer/trackwrap.cpp +++ b/source/designer/trackwrap.cpp @@ -1,5 +1,6 @@ #include #include +#include #include "3d/tracktype.h" #include "selection.h" #include "trackwrap.h" @@ -21,15 +22,15 @@ TrackWrap::~TrackWrap() delete i->second; } -void TrackWrap::render(const GL::Tag &) const +void TrackWrap::render(GL::Renderer &renderer, const GL::Tag &) const { for(list::const_iterator i=wraps.begin(); i!=wraps.end(); ++i) { - GL::PushMatrix _pushm; + GL::MatrixStack::Push push(renderer.matrix_stack()); const Vector &pos = i->track->get_position(); - GL::translate(pos.x, pos.y, pos.z); - GL::rotate(i->track->get_rotation()*180/M_PI, 0, 0, 1); - i->mesh->draw(); + renderer.matrix_stack() *= GL::Matrix::translation(pos.x, pos.y, pos.z); + renderer.matrix_stack() *= GL::Matrix::rotation(i->track->get_rotation(), 0, 0, 1); + i->mesh->draw(renderer); } } diff --git a/source/designer/trackwrap.h b/source/designer/trackwrap.h index 480e7bb..070794e 100644 --- a/source/designer/trackwrap.h +++ b/source/designer/trackwrap.h @@ -27,7 +27,7 @@ public: TrackWrap(R2C2::Layout3D &, Selection &); ~TrackWrap(); - virtual void render(const Msp::GL::Tag &) const; + virtual void render(Msp::GL::Renderer &, const Msp::GL::Tag &) const; private: void selection_changed(); -- 2.45.2