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

50 lines
3.5 KiB
Plaintext
Raw Permalink Normal View History

[video output=day013 member=cmuratori stream_platform=twitch stream_username=handmade_hero project=code title="Platform-independent User Input" vod_platform=youtube id=Lt9DfMzZ9sI annotator=jacebennett annotator=Miblo]
[0:40][Overview of the day's goals]
[2:35][Function Overloading (accidental and intentional)]
[7:29][Extending GameUpdateAndRender() to take input]
[8:33][Pulling structs into a header file for readability]
[9:48][On iterating towards an API and avoiding premature design]
[13:35][Writing our usage code first]
[15:12][Diagram of input over time]
[20:47][Looking at one common method of parsing game input]
[23:43][An less expressive but simpler way]
[28:29][But Casey, what about the stick?]
[35:47][Writing usage for some game_input structures]
[37:51][Adding the structures and filling them out]
[40:45][Handmade Hero: Better than cooking shows!]
[42:14][Porting our platform layer over to the new API]
[46:16][Factoring out button processing into Win32ProcessXInputDigitalButton()]
[48:47][Processing all the buttons]
[51:11][ArrayCount() used but not implemented yet]
[53:16][Swapping NewInput and OldInput, how do we want to do it?]
[54:36][Finally defining NewInput and OldInput]
[56:04][More explanation about swapping]
[57:28][Defining the ArrayCount() macro]
[58:50][But Casey, what about the stick?]
[1:00:11][Normalizing our stick values]
[1:04:54][Wrap up and Final Thoughts]
[1:06:55][Q&A][:speech]
[1:07:05][When normalizing the thumbstick value, is it worse to just add 32768 then multiply it by 2/65535 then subtract 1? I don't like the necessary if statement personally.]
[1:08:45][Nitpick, but is it a bit misleading that the half transition count is zero or one, rather than an actual count?]
[1:09:17][Will we be completely ignoring platform code for most of the rest of the series?]
[1:09:48][Can you describe the struct inside of the union in more detail?]
[1:13:37][Does it give any problems with capturing inputs over time when, due to some circumstances from Windows, the game lags and the frame timebase expands?]
[1:16:03][Your normalizing code has an error, they both divide by positive.]
[1:17:53][What happens if there's a name conflict between struct scope and a non-nested struct?]
[1:18:35][Do you plan on abstracting the input more. For example, instead of having a player respond to a button press, have them respond to an action that is bound to a button or stick?]
[1:20:01][Why is GameUpdateAndRender() internal when it's designed to be called from the platform layer?]
[1:20:35][Comment about using re-bindable keys and buttons for left-handed people.]
[1:21:17][When will you decide to actually remove all the TODOs in your code?]
[1:21:51][Aside about rebindable keys.]
[1:23:01][How is the old controller persisted across frames?]
[1:23:59][Will the Windows callbacks for keyboard inputs require a great deal of extra work for you to implement?]
[1:25:18][What about people who only have left arms?]
[1:25:45][Will we eventually be using a timer to poll the controller input, or just a thread?]
[1:26:40][timeBeginPeriod(1) will tick at 1 millisecond resolution.]
[1:27:37][Have you done much physics coding, related to games or otherwise?]
[1:28:25][Would you be fine with people using the platform as a base for making their own games, with attribution?]
[1:29:49][How much will you need to explore other platforms before knowing what the abstraction API will look like?]
[1:30:26][What kinds of numerical methods are used in game physics?]
[1:31:26][Final Wrap Up][:speech]
[/video]