[158] Most Important Brick in the Least Important Wall
- Conlan Walker
- 4 hours ago
- 2 min read
For the last full week I'll be considered a non-alumni, I wanted to eke out one more project before I go on what will likely be an extended break of sorts.
At the start of the week, I set out to create a Win32 + OpenGL demo from absolute scratch, which means no loader libraries of any sort. I already made the windowing and input libraries Win32-side in a previous project, so I knew I only needed to worry about the OpenGL part.
The catch was that I knew basically nothing about how modern OpenGL works. Thankfully, I somehow got the basic functions and extensions working by Tuesday.
I was originally going to make a ray-marching renderer, however the code I wrote for Shadertoy didn't work when I tried moving it to the environment I set up, and I didn't have the time to fix whatever was wrong with it before Friday. So, I pivoted to making a hardware-accelerated, interactive version of the software-rendered metaball demo I've shown that used the same windowing and input framework.
I had a lot of issues finding a good balance of bitrate-to-resolution-to-framerate such that the recording for this didn't come out choppy in OBS, but I managed to find something that mostly works. Sometimes the recording skips back a frame momentarily (which doesn't happen if you run the demo yourself), and my only guess is that the reason is because I didn't enable VSync, and I'm just using Win32's Sleep() function to limit the framerate, like I did with the previous metaball demo.
The result is this, and I'd say I did a pretty good job with it, especially as a first project working with modern OpenGL:
SPOILERS BELOW; DON'T SCROLL DOWN UNTIL YOU WATCH THE VIDEO!
SPOILERS BELOW; DON'T SCROLL DOWN UNTIL YOU WATCH THE VIDEO! SPOILERS BELOW; DON'T SCROLL DOWN UNTIL YOU WATCH THE VIDEO!


As a sidenote, this is what you need to do to create an OpenGL 3.3 context on Windows by yourself. On Windows, you literally need to make an OpenGL 1.1 context in order to make a 3.3 context. Five long hours well spent trying to make this BS work:

And last, but not least (by volume), the actual code:

Comments