Hacker News new | ask | show | jobs
by continuational 3703 days ago
But still, just one page of code? Ideally, drawing a quad should be a one-liner.
2 comments

If you want to use a higher-level framework then one-liner might make sense.

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.

OpenGL is set up to optimize for all those things, instead of optimizing for the learner/simple case.

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.

There is also kiss3d for some higher-level rendering:

https://github.com/sebcrozet/kiss3d/blob/master/examples/cub...