openframeworks / openframeworks/openFrameworks

deprecate ofBackground or refactor to mean ofClear

Open
#3,566 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

core feature prelim-analysis section-2D section-internals
Dominant language
C++
Stars
10.4k
Forks
2.6k
Avg merge
1d 21h
Merged PRs (30d)
9

Description

this suggestion comes from a discussion with @ofzach last week.

right now we have a few functions for working with the background in OF:

  1. ofClear(): clears the background color right away
  2. ofBackground(): clears the background color right away, and saves the background color
  3. ofSetBackgroundColorAuto(): enables or disables whether the saved background color is used to clear the screen at the beginning of each frame
  4. ofSetBackgroundColor(): changes the saved background color without clearing the screen

having so many functions creates confusion. the only reason that anything besides ofClear() exists is because processing sets an example of putting the background() call in setup() as if it is a property of the document rather than an action.

i suggest we only use ofClear(). alternatively, we can change the name of ofClear() to ofBackground() and note in the changelog that it doesn't work in setup() anymore.

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 four background-related functions named in the issue: ofClear(), ofBackground(), ofSetBackgroundColorAuto(), and ofSetBackgroundColor(). Check their current usage and the discussion referenced in the issue. Done means the API direction is decided and the corresponding deprecation or rename, behavior changes, and changelog updates are agreed and implemented.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.