iankernels/cube.c-SDL2 — reverse-engineered prompt

Reverse engineered prompt

Build me a tiny desktop demo in C that recreates the classic cube.c style spinning 3D cube, but rendered in an SDL2 window instead of the terminal. I want it to open a window and continuously draw the cube in motion, with simple perspective so it actually looks 3D, and it should match the feel of the screenshot and linked video as closely as possible.

Please keep it lightweight and easy to run, with a normal build setup so I can compile it with either make or CMake. If anything is missing, add whatever small fixes are needed so the project builds cleanly and the demo starts right away. Keep the code in one main C source file if that still makes sense, and make it readable since this is meant to be a simple visual demo, not a huge engine. If you need details about SDL2 setup or platform quirks, feel free to look up the current docs online.

Want more depth? Deep Reverse