openframeworks / openframeworks/openFrameworks
compile warning: hidden overloaded virtual function
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 10.4k
- Forks
- 2.6k
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 9
Description
Hello!
As of 0.8.0-154-g45fec9b, it looks like ofBaseRenderer::setupScreenOrtho() and ofNoopRenderer::setupScreenOrtho() have incompatible signatures even though one is meant to overload the other:
virtual void ofBaseRenderer::setupScreenOrtho(float width = 0, float height = 0, float nearDist = -1, float farDist = 1){}
virtual void ofNoopRenderer::setupScreenOrtho(float width = 0, float height = 0, ofOrientation orientation=OF_ORIENTATION_UNKNOWN, bool vFlip = true, float nearDist = -1, float farDist = 1){};
If this is not a known issue, or doesn't exist for a good reason, does anybody have a suggested resolution for this? I'd be happy to implement & test.
It's currently issuing the following build warning:
In file included from ../../../libs/openFrameworks/app/ofAppNoWindow.cpp:1:
../../../libs/openFrameworks/app/ofAppNoWindow.h:72:15: warning: 'ofNoopRenderer::setupScreenPerspective' hides overloaded virtual function [-Woverloaded-virtual]
virtual void setupScreenPerspective(float width = 0, float height = 0, ofOrientation orientation=OF_ORIENTATION_UNKNOWN, bool vFlip = true, float fov = 60, float nearDist = 0, float farDist = 0){}
^
../../../libs/openFrameworks/types/ofBaseTypes.h:312:15: note: hidden overloaded virtual function 'ofBaseRenderer::setupScreenPerspective' declared here
virtual void setupScreenPerspective(float width = 0, float height = 0, float fov = 60, float nearDist = 0, float farDist = 0){}
^
In file included from ../../../libs/openFrameworks/app/ofAppNoWindow.cpp:1:
../../../libs/openFrameworks/app/ofAppNoWindow.h:73:15: warning: 'ofNoopRenderer::setupScreenOrtho' hides overloaded virtual function [-Woverloaded-virtual]
virtual void setupScreenOrtho(float width = 0, float height = 0, ofOrientation orientation=OF_ORIENTATION_UNKNOWN, bool vFlip = true, float nearDist = -1, float farDist = 1){};
^
../../../libs/openFrameworks/types/ofBaseTypes.h:313:15: note: hidden overloaded virtual function 'ofBaseRenderer::setupScreenOrtho' declared here
virtual void setupScreenOrtho(float width = 0, float height = 0, float nearDist = -1, float farDist = 1){}
^
2 warnings generated.
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 with the setupScreenPerspective and setupScreenOrtho declarations in libs/openFrameworks/app/ofAppNoWindow.h and libs/openFrameworks/types/ofBaseTypes.h. Reproduce the compiler warning from the affected C++ build and compare the overload signatures. Done means the incompatible or hidden overload warnings are resolved without breaking the renderer interface.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100