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

52 lines
3.8 KiB
Plaintext
Raw Normal View History

[video output=day191 member=cmuratori stream_platform=twitch stream_username=handmade_hero project=code title="Implementing a Radial Menu" vod_platform=youtube id=ftZIujU3Udw annotator=Miblo annotator=debiatan]
[0:07][Recap and plan for today]
[1:31][Try something epically ridiculous][quote 251]
[3:02][We want to be able to turn on and off parts of the debug interface]
[4:30][At the moment, the live looped code editing overrides our input, so it precludes interaction with the debug UI]
[5:17][Using the right mouse button as a "clutch"]
[6:32][Turning on and off the profiler]
[7:43][Start writing code at the place you know how to code]
[9:49][Drawing a radial menu]
[10:48][Let's pretend we have some menu items]
[12:15][Drawing the menu items]
[13:40][(Blackboard) Positioning text strings around a circle]
[16:19][Implementing Arm2]
[18:15][Testing it. Looks OK, but are the labels centered?]
[18:30][Marking the center of the circle]
[20:32][Centering the text]
[22:00][The code required to measure the dimension of labels has much in common with the code that draws them. Let's make sure the implementation of those operations does not fall out of sync]
[24:57][Pulling the bitmap size computation out of PushBitmap to make it callable from other functions]
[28:49][Defining debug_text_op]
[29:43][PushBitmap will ignore non-loaded bitmaps]
[32:11][Pre-pushing the debug font at DEBUGStart]
[35:00][Fixing some compilation errors]
[36:10][Computing the dimensions of a text string by computing the union of the rectangles of each of its glyphs]
[39:00][Implementing the rectangle2 version of the inverted infinity rectangle]
[42:26][Testing our new code. Implementing DEBUGGetTextSize]
[43:39][Drawing the boundaries of the text labels to check their placement]
[45:30][The placement of the labels is exact]
[45:40][Some thoughts on the "operation" code transformation]
[47:01][Centering the labels]
[48:17][Finding out the menu index closest to the mouse pointer to change its color]
[53:14][Activating menu items]
[53:37][Do something like this][quote 250]
[56:30][Testing it]
[58:39][Placing the radial menu relative to the mouse position at the time it was invoked]
[59:53][Coming attractions]
[1:00:37][Q&A][:speech]
[1:01:04][@andsz_][I think you added v3.xy for v3-to-v2 conversion]
[1:01:46][@elxenoaizd][Even if the menus in the circle get cluttered, we could make it so that each button in the circle lead us to another circle / layer / subset of buttons]
[1:02:17][@Sharlock93][Can you explain a bit more on that closure stuff and how to do it in C? I didn't quite understand it]
[1:07:57][@ijustwantfood][Why did you use radial menu over list or another format?]
[1:08:24][@elxenoaizd][It would be cool if the menu items are aligned with the circle borders, that way there's less chance of the text colliding]
[1:08:38][@elxenoaizd][You mentioned C doesn't officially support closures. Did you ever make an attempt to hack it, maybe via 'functors' or something like that?]
[1:09:00][@ScorpionResponse][Have you ever considered a debug output for the stream where we can see your keystrokes?]
[1:09:23][Anticipate mr4thdimention's editor 4coder]
[1:09:42][@elxenoaizd][Oftentimes when using somebody else's API / engine you end up having to 'fight' with it to have it do what you want from it. Do you think that is a sign that one should leave that API and try another / write his own instead of 'fighting' all the time?]
[1:15:18][@powerc9k][Are you ready for the world to end tomorrow as predicted by crazy Christians?]
[1:15:33][@Psi9][Since draw rectangle quickly is in its own translation unit, are you going to write that code in straight ASM instead of C / intrinsics?]
[1:15:50][@cubercaleb][Wait, isn't 4coder already better than Emacs?]
[1:16:10][@cubercaleb][Can you go into detail on I/O Completion Ports since you brought them up?]
[1:16:25][Wind it down][:speech]
[/video]