Adventures in OpenGL


I finally started learning SDL. Then I found out there were no primitives. Then I went to OpenGL. Then I found out you have to specify every single vertex you want to draw.

Well, hell.

I also found out that there’s a real dearth of OpenGL-SDL tutorials. There’s not that many OpenGL tutorials alone, for that matter. And on that subject, so you don’t have to (like I did) go “Ok, I should learn some OpenGL. Let’s look up some tutorials… Can’t find any. Going back to Dwarf Fortress,” about 50 times, here’s a good series of tutorials on OpenGL using GLUT that is pretty easily adaptable to SDL.

However, there may be a few things out of date - I just found an error with the tutorial on lighting. You can’t light faces colored with glColor3f and expect it to work. Here’s a good explanation on why, and how to fix the issue.

Overall, my experience with the library has been good - it’s just extremely noob-unfriendly. I don’t want to have to specify every single vertex of the three triangles that make up a pentagon - but really, that does give you a lot of flexibility. If you want to just make games, instead of programming them, stick with an engine. However, as my previous adventures in the Source Engine showed, my destiny is not to be a game designer, architect or someone who tries to build a virtual reality from scratch, placing bushes and sidewalks to simulate real locations - I’m to be the monkey that codes the stuff in the background.