Don't both DirectX and OpenGL both basically shrug and say "build your own god damn projection matrix, scrub" nowadays, anyway? I know modern OpenGL is driven by the shaders and deprecated the whole "state machine pipeline".
Been playing around with SFML again recently, since it's .NET bindings got ported to .NET Core. Playing around with building a game in F#, is interesting. Based how I handled the game state on the Redux/Elm model.
Figuring out a way to do game audio was a bit of a challenge, but I wound up building it as 'event driven' which actually I think works out pretty nice. I was able to build a 'soundtrack' system on top of it very quickly which just emits events to start songs and listens for the event emitted when the song finishes to automatically start the next song.
All in all the approach of chaining reducers and '
epics' seems like an interesting way to tackle a game. That approach is all about state management in a functional manner, and games are all about state. Whole thing is very multithreadable by 'default' too, since epics can be self-contained and run in the task pool and the state changes are just application of a sequential queue of actions to the state which produce a new state for the next action, so again can run on it's own thread.
Rendering can then be done by taking the snapshot of the state at the moment of render, and turning it into a tree of commands which is processed recursively by the rendering 'driver'. So it kicks into the renderer a data model that looks something like
[Viewport(rect 0.0 0.0 1.0 1.0, [
Projection(rect 0.0 0.0 320.0 240.0, [
Origin(vec2 160.0, 120.0, [
Shader(noirify, [("colourDrain", ShaderParam.Float 0.5)], [
BlitAt(vec2 0.0 0.0, texture)
])
])
])
])]