A Call From The Depths
Feature development on Angel Beats is paused as I'm currently in the process of switching the rendering layer from GDI+ to SDL. Upgrading to something with 3D support is something I had always been planning to do, and performance issues with GDI+ have become intolerable, so I decided that now was as good a time as ever.
Wins of switching to SDL so far:
- With the hardware accelerated renderer, draw time is down from 30ms to <1ms for the default window size. And even when scaled up to fullscreen it only increases to 2 or 3ms, and not tenfold like with GDI+. In other words, a 30fps cap to 100+. There is some overhead to using fonts, but with intelligent caching it should vanish.
- Total control over input queue. This was actually what got me started on the change. I wanted higher resolution for mouse move events than what WM_MOUSEMOVE was providing in order to track when the mouse entered and exited widgets. And I couldn't rely on WM_MOUSEENTER and WM_MOUSEEXIT since I've built a custom widget framework that Windows doesn't know anything about. This could have theoretically been solved by using the lower level WM_INPUT events or by using the delta between WM_MOUSEMOVE events to interpolate the mouse path, but I like having access to the input source a whole lot better.
- No more screen tearing. This one was something I didn't expect and happened to notice when testing compass menus. Even when rapidly open and closing them there was no visible tear. I still don't know why it was happening with GDI+ since it was using double buffering, but in any case, it's gone now.
Downsides have been bearable. There is more explicit resource management required to prevent memory leaks. And it's going to take some time to get fonts looking pretty. But already I'm more than happy with the change and am convinced it was totally worth it. SDL's API is really well documented and does a good job of sticking to an abstraction level.
Descending from high level features to low level details always sucks, but I think what's made it relatively painless and even enjoyable this time is knowing that I'll be able to go all the way with SDL. It's a stable foundation not just for 2D applications but also for 3D game engines. And like I said before, one of the meta-goals of Angel Beats is raising the level of GUIs to video games and beyond.
I also want to emphasize that this only touches rendering and nothing else. Windows native widgets are too weak and inflexible for what I need, so I built a GUI framework that 2D rendering, layout, and event routing, as well as an accompanying widget library. I can talk more about that in future devlogs if people are interested.
To use Tears of the Kingdom as a metaphor, I'm currently making my way through the depths, but the sky islands are still in sight and I'll be back to them soon!
Get Angel Beats
Angel Beats
integrated songwriting environment
Status | In development |
Category | Tool |
Author | Joe Betz |
Tags | MIDI, Music, Music Production, sequencer, songwriting |
More posts
- Reflections and ProjectionsAug 26, 2023
- Patch Notes, v0.5.1Jun 30, 2023
- Update Notes, v0.5.0 - MIDI OutputJun 27, 2023
- How to Use Soundfonts for PlaybackJun 27, 2023
- How to Create a Virtual MIDI DeviceJun 27, 2023
- Patch Notes, v0.4.1Jun 19, 2023
- Update Notes, v0.4.0Jun 17, 2023
- Update Notes, v0.3.0May 25, 2023
Leave a comment
Log in with itch.io to leave a comment.