Permalink
Browse files

Extent program parameter get interface to support more than one retur…

…ned int value (closes #354)
  • Loading branch information...
scheibel committed Sep 28, 2017
1 parent 8909b43 commit 275f159d1f664a745fd2d0408698ce77f3279ab3
Showing with 12 additions and 0 deletions.
  1. +2 −0 source/globjects/include/globjects/Program.h
  2. +10 −0 source/globjects/include/globjects/Program.inl
@@ -125,6 +125,8 @@ class GLOBJECTS_API Program : public Object, protected ChangeListener, public Ch
std::string infoLog() const;
gl::GLint get(gl::GLenum pname) const;
template <size_t Count>
std::array<gl::GLint, Count> get(gl::GLenum pname) const;
bool isValid() const;
void validate();
@@ -115,5 +115,15 @@ void Program::attach(Shader * shader, Shaders... shaders)
attach(std::forward<Shaders>(shaders)...);
}
template <size_t Count>
std::array<gl::GLint, Count> Program::get(gl::GLenum pname) const
{
std::array<gl::GLint, Count> values;
glGetProgramiv(id(), pname, values.data());
return values;
}
} // namespace globjects

0 comments on commit 275f159

Please sign in to comment.