cinera_handmade.network/cmuratori/hero/code/code167.hmml

42 lines
3.2 KiB
Plaintext
Raw Permalink Normal View History

[video output=day167 member=cmuratori stream_platform=twitch stream_username=handmade_hero project=code title="Finishing Win32 Font Glyph Extraction" vod_platform=youtube id=Hc33CNhmAg8 annotator=Miblo annotator=debiatan]
[0:15][Recap and plan for today]
[1:16][First, let's solve two small problems with the code introduced during the previous episode's Q&A]
[2:31][Back to fonts]
[3:11][Getting antialiased fonts through Windows]
[3:39][Maybe creating a color CompatibleDC will get us AA. No, that doesn't help]
[5:20][Using CreateDIBSection to have more control over the bitmap we create]
[10:06][Initializing the BITMAPINFO passed to CreateDIBSection]
[13:45][Yes, that worked!]
[14:21][Get the contents of the bitmap directly, without issuing an OS call for each pixel]
[21:30][Our pixel pointer shows only zeros. Why is that?]
[29:57][(aside) On Handmade Hero we want to understand our code]
[31:18][Wiping out the bitmap to see if that change is visible through our pixel pointer]
[32:32][This bitmap is a lie][quote 171]
[33:00][Shrinking the bitmap to see it more easily inside the debugger's memory watch window]
[34:12][The bitmap goes bottom-up!]
[36:44][Accessing pixels directly instead of through GetPixel]
[41:40][Removing the debug black background]
[42:14][Reintroducing the 1-pixel apron around the glyphs]
[47:26][Testing today's changes]
[48:12][Checking our results against Wordpad's font rendering]
[49:23][Q&A][:speech]
[50:13][@marius_av][You should have passed GetDC(0) to CreateCompatibleBitmap, not CreateCompatibleDC. But that's fine, you would still have to use a different method to access bitmap data efficiently]
[50:50][@MrMuffles869][Hi there. I'm rather new to HMH. Do you ever talk about your keybindings that help you navigate more easily?]
[51:30][@waterlimon][Why is arbitrary padding required for the glyph bitmap? Is the correct method used for retrieving the actual glyph size?]
2017-12-24 00:16:27 +00:00
[51:52][@garlandobloom][Q: Tell us your NASA secrets]
[52:53][@waterlimon]["arbitrary" = 2 extra for width/height]
[54:07][@aameen95][Do you think that this stream got wasted?]
[56:43][@Robrobby][Still a better debugger would have lead you to the solution much faster]
[57:04][@Pseudonym73][Just to clarify, it's okay to delete code that you don't understand and replace it with code that you do understand, as an alternative to trying to understand code that you don't understand?]
[58:37][@Theup511][Did you turn down a twitch partnership?]
[1:00:07][@TheSizik][Have you thought about making a handmade asset viewer?]
2017-12-24 00:16:27 +00:00
[1:00:18][@garlandobloom][Q: Abner always lies and I always tell the truth, you may ask one question]
[1:00:30][@Childz][Does a better debugger exist?]
[1:00:37][@Pseudonym73][The reason why I ask is that I've written code that I subsequently really had to write off]
[1:01:10][@SoysauceTheKid][I need my Casey emotes though]
2017-12-24 00:16:27 +00:00
[1:02:39][@abnercoimbre][Q: We're out of questions, but you made my life difficult tonight XD. You know I'm under NDAs like you. YOU KNOW HOW IT IS, BRO]
[1:03:46][@Zamar037][The chat wants you to play the Vista video again]
[1:03:54][@dgmtv][Should I stop using templates for my containers and adopt void* for ever?]
[1:06:02][Wind this down][:speech]
[/video]