From: Mikko Rasa Date: Thu, 26 Apr 2018 10:46:06 +0000 (+0300) Subject: Add const overload for AnimatedObject::get_shader_data X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=97b8f0d945474582c2213b70418d399e5641f0d5;p=libs%2Fgl.git Add const overload for AnimatedObject::get_shader_data --- diff --git a/source/animatedobject.cpp b/source/animatedobject.cpp index 99466f20..257e1368 100644 --- a/source/animatedobject.cpp +++ b/source/animatedobject.cpp @@ -44,6 +44,13 @@ ProgramData &AnimatedObject::get_shader_data() return *shdata; } +const ProgramData &AnimatedObject::get_shader_data() const +{ + if(!shdata) + throw invalid_operation("AnimatedObject::get_shader_data"); + return *shdata; +} + void AnimatedObject::set_uniform(const string &name, const KeyFrame::AnimatedUniform &uni) { if(!shdata) diff --git a/source/animatedobject.h b/source/animatedobject.h index 3ec336fd..74e59fc8 100644 --- a/source/animatedobject.h +++ b/source/animatedobject.h @@ -38,6 +38,7 @@ public: void set_pose_matrix(unsigned, const Matrix &); ProgramData &get_shader_data(); + const ProgramData &get_shader_data() const; // Deprecated void set_uniform(const std::string &, const KeyFrame::AnimatedUniform &);