-
-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UPBGE: Use pimpl idiom for RAS_OpenGLRasterizer.
Previously all the function in RAS_IRasterizer were virtual pure functions overrided in RAS_OpenGlRasterizer. This was because some of the functions definition were using OpenGL calls. An alternative is to use an implemnt an interface. But this interface must be not included by all the includer of RAS_IRasterizer. To do so we must use a pointer to the interface. The interface is the previous RAS_OpenGLRasterizer, it is instantiated from the RAS_Irasterizer constructor into a std::unique_ptr which delete it automatically in the destructor. Function using OpenGL call like Enable(…) and Disable(…) are forwarded to interface instance. This mechanism is called the pimpl idom. The pimpl idiom avoid the virtual calls and then the multiple declaration. In the same time a little optimization is noticed of 4% (1/2ms less of 31ms).
- Loading branch information
1 parent
aa4b6a0
commit 849d065
Showing
14 changed files
with
2,182 additions
and
1,924 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.