I am still intrigued by your library. I find it strange that you hint that 
GLFW/SDL is not suitable for applications because they are not “event driven.” 
But almost nothing is “single frame” any more. When you hover over a button or 
there is a popup you want at least a couple frame of animation to for 
highlighting a button or fading in a popup. Many apps like music or video apps 
are basically animating every frame as they run. It's also really easy to turn 
a polling draw every frame system 100% CPU (like a game) into not polling 0% 
CPU (like an old app) by just sleeping frames. Something like: if animating: 
draw else: sleep.

It's also strange to me that you hint that OpenWL is not suitable for games. It 
looks like you are doing polling in your run loop as well: 
[https://github.com/dewf/openwl/blob/0e7174df19cf4e21a3581b9a2d79d97e49904ee7/source/win32/OpenWL.cpp#L205](https://github.com/dewf/openwl/blob/0e7174df19cf4e21a3581b9a2d79d97e49904ee7/source/win32/OpenWL.cpp#L205)
 It’s no different from what GLFW/SDL do. I recommend creating a “poll” 
interface instead of a run-for-ever interface. It is what the OS gives you! 
Then it become suitable for games because games can sleep or draw between the 
pools, and any other app with animations (which is pretty much any app now) can 
use it.

Another reason for poll is that apps are not just graphics and input, they also 
have networking and you might need to poll on the select() function. You don’t 
know what the app maker needs to do while drawing the screen. Yes, you can use 
multiple threads but threaded apps are always more complex.

Here is what other libs do: Glfw: 
[https://github.com/treeform/quickcairo/blob/master/examples/realtime_glfw.nim#L62](https://github.com/treeform/quickcairo/blob/master/examples/realtime_glfw.nim#L62)
 SDL: 
[https://github.com/treeform/quickcairo/blob/master/examples/realtime_sdl2.nim#L56](https://github.com/treeform/quickcairo/blob/master/examples/realtime_sdl2.nim#L56)
 Glut: 
[https://github.com/treeform/quickcairo/blob/master/examples/realtime_glut.nim#L66](https://github.com/treeform/quickcairo/blob/master/examples/realtime_glut.nim#L66)

You are doing it the Glut way, I don’t recommend it.

Any plans for iOS or Android? Maybe mobile version of your library? Kind of 
like GLFW/GLFM: 
[https://github.com/brackeen/glfm](https://github.com/brackeen/glfm)

Reply via email to