You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently SDLGame handles the "magic" of initialising SDL (and the various SDL submodules), creating a window, creating a GL context and initialising the APG logger. This has two effects:
Nothing with APG can realistically be done before these things are initialised.
This forces a recursive "unique_ptr" bloat across the whole codebase, which makes initialisation much more complicated, adds overhead and exposes us to various nullptr bugs which wouldn't happen if the classes we were creating were just members.
By moving SDLGame's constructor logic out into a separate class which owns the SDL/GL context, we add an extra initialisation step before getting a working screen, but the gains outweigh the losses.
It might be possible to avoid a breaking API change by creating an entirely new game class, perhaps using CRTP... but it might be cleaner, given that APG is not widely used, to just break SDLGame.
The text was updated successfully, but these errors were encountered:
Currently SDLGame handles the "magic" of initialising SDL (and the various SDL submodules), creating a window, creating a GL context and initialising the APG logger. This has two effects:
By moving SDLGame's constructor logic out into a separate class which owns the SDL/GL context, we add an extra initialisation step before getting a working screen, but the gains outweigh the losses.
It might be possible to avoid a breaking API change by creating an entirely new game class, perhaps using CRTP... but it might be cleaner, given that APG is not widely used, to just break SDLGame.
The text was updated successfully, but these errors were encountered: