openframeworks / openframeworks/openFrameworks
Calling ofGetScreenWidth() causes massive slow down on Ubuntu
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 10.4k
- Forks
- 2.6k
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 9
Description
Hi, I found out calling ofGetScreenWidth() or ofGetScreenHeight() causes frame rate to drop to 2~3 fps on Ubuntu.

You can test this by simply adding this code inside update()
ofGetScreenWidth();
cout << "frameRate : " << ofGetFrameRate() << endl;
I use OF_0.9.8_release and I found a relevant commit here. https://github.com/openframeworks/openFrameworks/pull/5028
But the problem still occurred even after applying the fix.
Calling ofGetWidth() or ofGetHeight() didn't slow down the app though.
I would appreciate if any Linux user can confirm this.
Thanks in advance!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the slowdown in update() with ofGetScreenWidth() or ofGetScreenHeight(), comparing it with ofGetWidth() and ofGetHeight() on Ubuntu. Review the linked pull request 5028 and trace the implementations of these screen-size entry points. Done means the screen-size calls no longer reduce the frame rate to 2–3 fps.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, linux, ubuntu
- Domain
- operating-systems, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100