I say this as someone who's written ~2 commercial renderers from some various degrees from scratch. Normally it's 1-2 days to just setup all the various infra for handling shaders/uniforms/etc.
I say this as someone who's written ~2 commercial renderers from some various degrees from scratch. Normally it's 1-2 days to just setup all the various infra for handling shaders/uniforms/etc.
https://github.com/tomaka/glium/blob/master/examples/tutoria...
That includes: Window creation and event handling, fragment shader, vertex shader, varying declaration and binding. Uniforms are pretty trivial on top of this(also done via macros so there's no raw strings).
The whole tutorial is really solid: http://tomaka.github.io/glium/book/tuto-01-getting-started.h...
Next time I'm starting up a GL project it's going to be hard for me to argue C/C++ given how nice some of the semantics around Rust's OpenGL libraries are.
For OpenGL you want control over state changes, uniforms and a slew of other things. Otherwise your performance/control will suffer significantly.
Look at the things I listed there, that's the bare minimum you need to do the above, and fitting that in one page is pretty impressive.
It's definitely a valid approach, but it means for simple cases, you're copy & pasting a lot of boilerplate for performance, control, and a slew of other things you don't need.
You have to learn/paste a lot before you get a little reward.
https://github.com/sebcrozet/kiss3d/blob/master/examples/cub...