We are currently in the process of converting the website to the new design. Some pages, like this one, are still broken. We appreciate your patience.
Ginger Bill
Here are some of my favourites: // Static Assertion #define STATIC_ASSERT3(cond, msg) typedef cha…
»
rizoma
you forgot to paste the win32_handmade.h file, so I can't check but.. You should try this: } [/c…
»
rizoma
Ahh the magic of assembly, I will try to look at the disassembly more often! Thanks Mr.Mārtiņš…
»
Mārtiņš Možeiko
I was talking about VS2013 which doesn't understand -Wv:18 argument. It's actually an error, not w…
»
Mārtiņš Možeiko
I have used computed goto for gcc compiler before and it does creates better code. Here's a micro-…
»
Benjamin Pedersen
Maybe, but I tried using -Wv:30, and VS2015 just did what it normally would. I have never done a…
»
Casey Muratori
I am skeptical that these computed gotos are necessary to get the "improved" performance. For exa…
»
Simon Anciaux
Thanks, I wanted to be sure I wasn't misunderstanding what the lfb was.
»
Mārtiņš Možeiko
Computed goto statements are a very nice thing. They allow to create lower-overhead interpreters t…
»
Mārtiņš Možeiko
That's how Casey is using real windows.h - he directly calls W or A functions. No need for macros.
»
Sean Barrett
This is technically outside the scope of stb_truetype; what the font defines the values to and wha…
»
ratchetfreak
struct State{ int pc; }; #define DrYield(c,v) do{ state->pc = c; return(v); resume_##c:; } while…
»
Allen Webster
My favorite macro trick is for making something that looks like a resumable function call, sort of…
»
PassiveCoder
I like that even more, good thinking.
»
Daniel Rasmussen
Here's a little trick to creating generic functions and types. Multiple include with the same file…
»
ratchetfreak
[/quote] That's not complete without
»
Jason
I wonder if some kind soul could spend some time and tell me where I went wrong with the live code…
»
Horrowind
Not too interesting, but funny:
»
Casey Muratori
Thanks for the kind words! Really glad the series had that effect. It's had the same effect for …
»
Randy Gaul
When I did this I didn't bother replicating the macros, and instead hard-coded with A suffixes. So…
»
Abner Coimbre
The fixing of the bugs has led Jeroen to redesign some key aspects of the data model and further …
»
Bl00drav3n
Regarding the latest episode, where Casey thought about calling pow(x, 2.2) for gamma correction, …
»
PassiveCoder
oh nice catch, thanks mmozeiko
»
Mārtiņš Možeiko
But adding -Wv:18 will generate warning for VS2013 users. VS2015 users need to modify build script…
»
Mārtiņš Možeiko
I dislike macros that create multiple statements. Doing them for definitions or declarations is fi…
»
Mārtiņš Možeiko
That's wrong. It should be GetModuleHandleW, because you are using LPCWSTR argument. That is wide …
»
Mārtiņš Možeiko
In this case it will be even better - compiler will notice that values you are initializing array …
»
Simon Anciaux
Hi, I'm using stb_truetype.h and I've got some questions on how to properly position characters. I…
»
rizoma
While reading the k&r book I found an interesting example (at least for a noob like me) of what I …
»
PassiveCoder
Oh my goodness, how embarrassing! That was it, also I had to define GetModuleHandle as GetModuleHa…
»