Skip to content

Commit

Permalink
ofScopedMatrix (#7946)
Browse files Browse the repository at this point in the history
#changelog #gl
  • Loading branch information
artificiel committed May 14, 2024
1 parent 4621d70 commit d17ba23
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions libs/openFrameworks/graphics/ofGraphics.h
Original file line number Diff line number Diff line change
Expand Up @@ -972,6 +972,24 @@ void ofPushMatrix();
/// \sa ofPushMatrix()
void ofPopMatrix();

/// \brief Manages a an ofPush/Pop Matrix cycle with an anonymous scoped object
///
struct ofScopedMatrix {
ofScopedMatrix() { ofPushMatrix(); }
~ofScopedMatrix() { ofPopMatrix(); }
};

/// \brief Manages a an ofPush/Pop Style cycle with an anonymous scoped object
///
struct ofScopedStyle {
ofScopedStyle() { ofPushStyle(); }
~ofScopedStyle() { ofPopStyle(); }
};

/// \brief Combines ofScopeMatrix and Style
///
struct ofScopedMatrixStyle: public ofScopedMatrix, public ofScopedStyle { };

/// \brief Query the current (oF internal) Transformation Matrix state.
glm::mat4 ofGetCurrentMatrix(ofMatrixMode matrixMode);

Expand Down

0 comments on commit d17ba23

Please sign in to comment.