New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create a virtual ofBaseMainLoop to allow custom loop implementations #5470
Comments
just to clear up what i said in the forum, the idea would be to have a new base class, ofBaseMainLoop, have ofMainLoop extend that and ofSetMainLoop accept an ofBaseMainLoop instead of an ofMainLoop. People wanting to create their own loops can extend ofBaseMainLoop |
The fact that ofMainLoop::addWindow Why don't they receive ofAppBaseWindow instead? |
didn't remembered about that, that method is templated so it can call some methods on the class itself rather than the instance which wouldn't work with dynamic dispatching. there's some ways to do this but it's more complicated than i though, ofSetMainLoop would probably need to be templated so it can accept any mainloop class but not 100% sure on the details, i'll take a look when i have a moment |
So far I've just moved the templated method to the base. Changes here. So far it works but the base interface looks a bit ugly.
Not sure what you mean. Maybe it can be fixed forcing ofAppBaseWindow (or ofAppBaseGLWindow) inheritance instead of the templated |
Based on forum thread
Now that the main loop is nicely isolated to an external class it seems useful to allow users to extend or change the functionality.
I'll give it a shot and PR later
Must be done before #3489
Related #5122
The text was updated successfully, but these errors were encountered: