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

53 lines
4.5 KiB
Plaintext
Raw Permalink Normal View History

[video output=day188 member=cmuratori stream_platform=twitch stream_username=handmade_hero project=code title="Adding Hover to the Debug Graphs" vod_platform=youtube id=1llPa4I7gYk annotator=Miblo annotator=debiatan]
[0:15][Recap and plan for today]
[1:22][The game runs slow because every frame we're collating all events for the past 64 debug frames]
[2:10][Decreasing the amount of debug frames we process from 64 to 8]
[4:01][We want to extract more information from the debug display]
[6:20][We want the debug display to show us information associated to any bar when we hover over it]
[6:45][Passing the game input to the debug system so that it can access the mouse position]
[7:47][Checking if the mouse position falls inside any given rectangle]
[10:05][The information to display will come from a debug_record associated to the debug_frame_region]
[11:45][Adding a debug record and a cycle count to debug_frame_region]
[13:23][Building a rectangle to test if the mouse pointer falls inside]
[16:30][Implementing a version of PushRect that takes a rectangle as its argument]
[17:44][Testing. It runs but hovering doesn't work yet]
[18:26][The mouse position is relative to Window' coordinate space, not to our rendering space]
[20:35][Transforming mouse coordinates to the game space]
[22:30][Hover works now]
[23:00][Changing the position of the debug text on the screen]
[25:01][Our ms/frame display shows 0 ms because we're computing it using the information from an unclosed frame]
[27:07][We don't want the game layer to depend on Windows' representation of mouse position. The platform layer should transform it into the game's coordinate system]
[28:30][Transforming the mouse position inside win32_handmade.cpp]
[30:30][(Blackboard) If we want the leftmost and rightmost columns of our backbuffer to have the same absolute X, the (0,0) coordinate will fall on a pixel boundary]
[38:41][Pausing collation]
[40:33][Defining enumerands for mouse buttons]
[43:06][Implementing WasPressed using the recorded HalfTransitionCount]
[45:06][Testing. It does not work]
[45:21][Cry about it][quote 242]
[46:58][We're not clearing the mouse state!]
[48:45][Clearing the half-transition count at the start of each frame]
[50:36][See if we can write something that's not total garbage][quote 243]
[52:17][Testing. It works]
[53:07][Q&A][:speech]
[53:31][@quartertron][Put the Pig Hat on the Owl]
[53:45][@Sharlock93][You had four Owl of Shame moments]
[53:56][@insofaras][Mouse code bugged for over 150 days, bring on the Owl]
[54:29][@Connor_Rentz][Will almond milk make me smarter?]
[54:43][@Sharlock93][And on behalf of all the people here, we love you and you are awesome]
[55:26][@epigone00][I'm new here. Why constrain yourself to 1-hour segments? Isn't ramp-up time every day hard?]
[56:29][@tombsar][How would you go about optimizing the debug rendering? It looks as though there is a lot of unnecessary work with EntityBasis calculation, etc.]
[57:42][build.bat: -O2 some of that up]
[58:57][@JamesWidman][You've trained everyone to listen for whether you pronounce the letter "t", or its allophone, the glottal stop, when you say the word "buttons"]
[59:23][@ChronalDragon][Shoot, wasn't paying attention and I used the mouse code in another program. What was broken about it?]
[59:42][@JamesWidman][At some point, would it make sense to pause and re-display the frame that is currently moused-over?]
[1:00:28][@Sharlock93][By the way, I'm from iraq, and it's 4am right now. Can you some time do early stream? I don't mind not sleeping until 4am, but in 2-3 weeks university starts and it would be awesome if you bring back early hours]
[1:00:59][@quartertron][I think you only render "top level" debug timed functions etc. Are you planning on "drilling down?"]
[1:01:12][@fierydrake][What is the other long bar? Some kind of frame wait? Should it be that long?]
[1:01:22][@d1srupt0r][Are you an indie developer and / or is this your professional job? If not, what is your day job?]
[1:01:47][@tombsar][I forget if the white line is 33ms or 16ms. Could you add a green line for 60Hz, orange for 30, and red for 10, or something?]
[1:02:09][@Eggsodragon][I noticed in task manager that all of my Steam games are 32-bit processes. Is there a really good reason to compile games in 32-bits rather than 64?]
[1:03:20][@SoysauceTheKid][The debug display is for processing time. Are you going to do any visuals for memory usage?]
[1:04:04][@Sharlock93][Would you be willing to do a 1-2 hour prestream?]
[1:04:20][Wind it down][:speech][quote 244]
[/video]