Gibbering commences now.
Though it's actually been a lot easier than that time when I implemented four-fifths of Xlib in terms of Cocoa.
Here's a gem: look upon my works and despair.
#define WRAP(NAME,SIG) \
void jwzgles_##NAME (ARGS_##SIG) \
{ \
if (state->compiling) { \
void_int vv[4]; \
FILL_##SIG \
list_push (STRINGIFY(NAME), (list_fn_cb) &jwzgles_##NAME, \
PROTO_##SIG, vv); \
} else { \
NAME (VARS_##SIG); \
} \
}
WRAP (glTranslatef, FFF)
You truly are the King of Kings.
It took me a couple of minutes of saying, "WTF, that's not Ruby," before I realized that you meant gem in the more (though perhaps not most) traditional sense.
Whippersnapper:
http://www.amazon.com/Graphic-Gems-Package-Graphics/dp/0122861663
And the motivation for doing this was....
If only there was a Previously link at the bottom of the post that explained it and gave more context.
Display list emulation . . . that's a circle of hell right?
I think technically it's a cons-cell of hell. Circularity not permitted.
I would like to revise and extend my previous statement.
Obviously I meant to say, "It is a cons-hell".
Of course real OpenGL implementations don't have preprocessor hacks like that... they have perl scripts to auto-generate all the terrible boilerplate and then do something terrible involving function pointers and dispatch tables to pick the right implementation (execute immediately or compile into a display list or throw an error because you haven't called glBegin).
I considered going down that path, but then I thought, hey, instead I could dick around with non-Turning-equivalent textual-subsitution-based half- or even quarter-assed preprocessors and spend all my time thinking about how you can't cast a double to a void* because blah blah blah registers blah blah it's still 1972.
All I wanted was #'defadvice. Is that too much to ask? Yes. Yes it is.
My first thought when I saw this was "well, at least he didn't use M4".
maybe when the last third gets implemented
Since you no longer work in software, is this just a masochism thing for you nowadays?
That's the first thing I thought. "he does this? in his free time?"
Well, I also drink a lot.
Some might say the drinking is less dangerous to your health.
Yers...I remember rummaging through the Xscreensaver source code to see how you'd ported all the hacks to Mac, and being horrified by jwxyz.c.
Amusing comments, though.
Curious... why did you do that? Thanks!