openframeworks / openframeworks/openFrameworks

ofPush/Pop()

Open
#1,493 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

core development-strategy feature
Dominant language
C++
Stars
10.4k
Forks
2.6k
Avg merge
1d 21h
Merged PRs (30d)
9

Description

Cinder has ci::gl::push/popModelView() and ci::gl::push/popProjection() which are wrapped by ci::gl::push/popMatrices

I think this kind of abstraction is great: starting by teaching people that they need to maintain camera states with push/popMatrices, then later showing them how to break that into parts (modelView, and projection).

What if we took this a step further with OF, and used ofPush/Pop() to mean ofPush/PopStyle() + ofPush/PopMatrix()?

Right now people wrap drawing code with one call or the other, but once they add an ofSetColor() or ofTranslate() they sometimes forget to add the other push/pop. We could encourage people to avoid this issue, and simplify code at the same time.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the existing ofPush/PopStyle() and ofPush/PopMatrix() entry points, along with the Cinder push/popMatrices comparison in the issue. Determine the intended API and compatibility implications before changing anything; done requires an agreed design and corresponding implementation and tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
computer-graphics
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.