Start with nothing in C: the first 3 hours
First Ludum Dare; second jam.
My self-imposed challenge is to build the game from scratch in C with no #includes or #defines. This means no libraries except the ones I link against and manually pre-declare as headers. (Meaning, in this case, just Windows, and no C runtime library.)
So far I've written a simple OpenGL loader, and this macro-less assertion handler:
static void assert_passed(void) {}
static void (*assert(bool condition))(void) {
if (condition) return assert_passed;
// stack trace printing code omitted
int result = MessageBoxA(NULL, textual_trace, "Assert Fired", 0x2102);
if (result == 3) ExitProcess(1);
if (result == 4) return NULL; // 4 represents "Retry" being clicked in the message box
return assert_passed;
}
// Usage code:
int swap_result = GL.wglSwapIntervalEXT(0);
assert(swap_result)(); // calls a NULL function pointer if "Retry" is clicked in the message box, crashing and/or trapping to debugger.
(I had to format the stack trace myself, because there's no printf!)
The big challenges will be asset loading and audio. I have written WASAPI code from scratch before, so I'll reuse that, but I've only ever done simple additive wave synthesis with it, so the music will be pretty minimalistic; more of a tracker-music vibe, probably. (I'm a fan of Fearofdark!)
Got simple fixed-function rendering going on right now to draw a blue square to the screen. Runs at about 7,000 FPS, so it's less than ideal, but it'll do for a game jam.