2 ms·
That would require knowledge of every platform specific graphics stack (wayland, win32, cocoa, ndk). How is this a feasible approach? Are you making your own cu
by fctorial 6y ago
That would require knowledge of every platform specific graphics stack (wayland, win32, cocoa, ndk). How is this a feasible approach? Are you making your own custom cross platform framework?
- jstimpfle 6y agoNo I'm just doing OpenGL. This is about cross platform - I don't really use the platform specific fuss. I need a window to draw to, and maybe a little file writing or networking code. I don't do Macs so far, so I can't tell you about that. I have a little boilerplate for setting up a window and getting input events for X11 (Linux) and Win32/GDI. It's about 300-400 lines each. You can opt to use GLFW3 instead to target all the big platforms with a single file that is also 300-400 lines. Mac is supported, too. I have mostly ceased to use GLFW since I prefer to code the stuff myself to have absolute control in case I need it, and to understand the issues of the platforms I have dealt with - but frankly GLFW is a very good and sleek library to get an OpenGL window and some inputs. Getting to the web using emscripten was similar. They support an older GLFW2 API so it was a matter of maybe 30 minutes to convert my GLFW code to run on the web. They also have a HTML5 API (html5.h) which is probably better, so I expect to add another couple hundred lines later at some point for that. Emscripten / the Web required me to port my desktop OpenGL code to OpenGL ES 3.0, which was quickly done and a very good idea to do anyway. And after all, the OpenGL rendering backend code is not that big either if your architecture is right. Mine is currently 700 lines, and it supports solid faces, textured faces, alpha-channels, subpixel font rendering - all of course for 2D and 3D.