Abstracting the Renderer Interface
?
?

Keyboard Navigation

Global Keys

[, < / ], > Jump to previous / next episode
W, K, P / S, J, N Jump to previous / next marker
t / T Toggle theatre / SUPERtheatre mode
V Revert filter to original state Y Select link (requires manual Ctrl-c)

Menu toggling

q Quotes r References f Filter y Link c Credits

In-Menu Movement

a
w
s
d
h j k l


Quotes and References Menus

Enter Jump to timecode

Quotes, References and Credits Menus

o Open URL (in new tab)

Filter Menu

x, Space Toggle category and focus next
X, ShiftSpace Toggle category and focus previous
v Invert topics / media as per focus

Filter and Link Menus

z Toggle filter / linking mode

Credits Menu

Enter Open URL (in new tab)
0:02Recap and set the stage for the day
🗩
0:02Recap and set the stage for the day
🗩
0:02Recap and set the stage for the day
🗩
0:49Walk through our test RenderLoop() with a view to streamlining the camera and fog code, and cleaning up the drawing calls in PushSimpleScene()
📖
0:49Walk through our test RenderLoop() with a view to streamlining the camera and fog code, and cleaning up the drawing calls in PushSimpleScene()
📖
0:49Walk through our test RenderLoop() with a view to streamlining the camera and fog code, and cleaning up the drawing calls in PushSimpleScene()
📖
3:34Our framerate problems incurred by the lighting
📖
3:34Our framerate problems incurred by the lighting
📖
3:34Our framerate problems incurred by the lighting
📖
6:12Crank up the grass sprite count in PushSimpleScene()
6:12Crank up the grass sprite count in PushSimpleScene()
6:12Crank up the grass sprite count in PushSimpleScene()
7:53Run the game and step in the RenderLoop() to see that we are using 184 bytes of our 64 megabyte-capacity PushBuffer
🏃
7:53Run the game and step in the RenderLoop() to see that we are using 184 bytes of our 64 megabyte-capacity PushBuffer
🏃
7:53Run the game and step in the RenderLoop() to see that we are using 184 bytes of our 64 megabyte-capacity PushBuffer
🏃
9:15Reduce the PushBuffer size to 1 megabyte
9:15Reduce the PushBuffer size to 1 megabyte
9:15Reduce the PushBuffer size to 1 megabyte
10:09Consider simplifying the PushBuffer out of the renderer API
10:09Consider simplifying the PushBuffer out of the renderer API
10:09Consider simplifying the PushBuffer out of the renderer API
16:26Change open_gl to no longer be initialised as a global variable, but locally by Win32InitOpenGL()
16:26Change open_gl to no longer be initialised as a global variable, but locally by Win32InitOpenGL()
16:26Change open_gl to no longer be initialised as a global variable, but locally by Win32InitOpenGL()
28:49Introduce platform_renderer to generalise our renderer and decouple it from the OpenGL API
28:49Introduce platform_renderer to generalise our renderer and decouple it from the OpenGL API
28:49Introduce platform_renderer to generalise our renderer and decouple it from the OpenGL API
35:04Introduce GetWhiteBitmap(), and continue the API decoupling, renaming DefaultRenderCommands() to BeginFrame() and OpenGLRenderCommands() to EndFrame()
35:04Introduce GetWhiteBitmap(), and continue the API decoupling, renaming DefaultRenderCommands() to BeginFrame() and OpenGLRenderCommands() to EndFrame()
35:04Introduce GetWhiteBitmap(), and continue the API decoupling, renaming DefaultRenderCommands() to BeginFrame() and OpenGLRenderCommands() to EndFrame()
41:38Set up implement platform_renderer dispatching
🗩
41:38Set up implement platform_renderer dispatching
🗩
41:38Set up implement platform_renderer dispatching
🗩
42:49Change LoadBMP() to call AddOp() and take a renderer_texture_queue and renderer_texture rather than call QueueTextureOp() and take a platform_renderer
42:49Change LoadBMP() to call AddOp() and take a renderer_texture_queue and renderer_texture rather than call QueueTextureOp() and take a platform_renderer
42:49Change LoadBMP() to call AddOp() and take a renderer_texture_queue and renderer_texture rather than call QueueTextureOp() and take a platform_renderer
46:50Introduce AllocateTextureQueue() and ProcessTextureQueue() for RenderLoop() to call
46:50Introduce AllocateTextureQueue() and ProcessTextureQueue() for RenderLoop() to call
46:50Introduce AllocateTextureQueue() and ProcessTextureQueue() for RenderLoop() to call
50:17Implement AllocateTextureQueue(), setting it up to use the platform memory allocation call
50:17Implement AllocateTextureQueue(), setting it up to use the platform memory allocation call
50:17Implement AllocateTextureQueue(), setting it up to use the platform memory allocation call
52:23Remove AllocateTextureQueue() in favour of making RenderLoop() call InitTextureQueue(), allocating memory in that call using Win32AllocateMemory()
52:23Remove AllocateTextureQueue() in favour of making RenderLoop() call InitTextureQueue(), allocating memory in that call using Win32AllocateMemory()
52:23Remove AllocateTextureQueue() in favour of making RenderLoop() call InitTextureQueue(), allocating memory in that call using Win32AllocateMemory()
55:19Respecify InitTextureQueue() to take MemorySize, and itself compute the possible TextureOpCount to fit in that memory
55:19Respecify InitTextureQueue() to take MemorySize, and itself compute the possible TextureOpCount to fit in that memory
55:19Respecify InitTextureQueue() to take MemorySize, and itself compute the possible TextureOpCount to fit in that memory
58:09Rename MaxVertexCount to MaxQuadCountPerFrame in RenderLoop(), leaving the possibility open for the platform to specially allocate the memory
58:09Rename MaxVertexCount to MaxQuadCountPerFrame in RenderLoop(), leaving the possibility open for the platform to specially allocate the memory
58:09Rename MaxVertexCount to MaxQuadCountPerFrame in RenderLoop(), leaving the possibility open for the platform to specially allocate the memory
1:00:15Reorder RenderLoop() slightly
1:00:15Reorder RenderLoop() slightly
1:00:15Reorder RenderLoop() slightly
1:01:11Make Win32InitOpenGL() allocate our open_gl, adding PushBufferMemory and textured_vertex and renderer_texture arrays to this struct
1:01:11Make Win32InitOpenGL() allocate our open_gl, adding PushBufferMemory and textured_vertex and renderer_texture arrays to this struct
1:01:11Make Win32InitOpenGL() allocate our open_gl, adding PushBufferMemory and textured_vertex and renderer_texture arrays to this struct
1:08:09Demo C++ inheritance to abstract the renderer
1:08:09Demo C++ inheritance to abstract the renderer
1:08:09Demo C++ inheritance to abstract the renderer
1:11:38Abstract out the renderer dispatch with an enum in platform_renderer, for newly introduced Win32AllocateRenderer(), ProcessTextureQueue(), BeginFrame() and EndFrame() to switch on
1:11:38Abstract out the renderer dispatch with an enum in platform_renderer, for newly introduced Win32AllocateRenderer(), ProcessTextureQueue(), BeginFrame() and EndFrame() to switch on
1:11:38Abstract out the renderer dispatch with an enum in platform_renderer, for newly introduced Win32AllocateRenderer(), ProcessTextureQueue(), BeginFrame() and EndFrame() to switch on
1:27:33Introduce OpenGLBeginFrame(), adding WindowWidth and WindowHeight to game_render_commands, and stubbing out the various API-specific functions
1:27:33Introduce OpenGLBeginFrame(), adding WindowWidth and WindowHeight to game_render_commands, and stubbing out the various API-specific functions
1:27:33Introduce OpenGLBeginFrame(), adding WindowWidth and WindowHeight to game_render_commands, and stubbing out the various API-specific functions
1:38:54Run the Renderer Test and check out our memory usage, to see that we have reserved 1.5 gigabytes
🏃
1:38:54Run the Renderer Test and check out our memory usage, to see that we have reserved 1.5 gigabytes
🏃
1:38:54Run the Renderer Test and check out our memory usage, to see that we have reserved 1.5 gigabytes
🏃
1:41:20Step through RenderLoop() to determine that EndFrame() allocates this memory
🏃
1:41:20Step through RenderLoop() to determine that EndFrame() allocates this memory
🏃
1:41:20Step through RenderLoop() to determine that EndFrame() allocates this memory
🏃
1:44:19Step through OpenGLEndFrame() into OpenGLChangeToSetting() to see that the first CreateFramebuffer() call reserves 300 megabytes
🏃
1:44:19Step through OpenGLEndFrame() into OpenGLChangeToSetting() to see that the first CreateFramebuffer() call reserves 300 megabytes
🏃
1:44:19Step through OpenGLEndFrame() into OpenGLChangeToSetting() to see that the first CreateFramebuffer() call reserves 300 megabytes
🏃
1:46:33Step in to CreateFramebuffer() to see that the glFramebufferTexture2D() call reserves 200 megabytes, and investigate whether this is reasonable
🏃
1:46:33Step in to CreateFramebuffer() to see that the glFramebufferTexture2D() call reserves 200 megabytes, and investigate whether this is reasonable
🏃
1:46:33Step in to CreateFramebuffer() to see that the glFramebufferTexture2D() call reserves 200 megabytes, and investigate whether this is reasonable
🏃
1:51:17Run the game and consider our high memory usage
🏃
1:51:17Run the game and consider our high memory usage
🏃
1:51:17Run the game and consider our high memory usage
🏃
1:53:29Temporarily disable multisampling in OpenGLInit()
1:53:29Temporarily disable multisampling in OpenGLInit()
1:53:29Temporarily disable multisampling in OpenGLInit()
1:53:49Run the game to see that it now only reserves 312 megabytes
🏃
1:53:49Run the game to see that it now only reserves 312 megabytes
🏃
1:53:49Run the game to see that it now only reserves 312 megabytes
🏃
1:54:09Re-enable multisampling in OpenGLInit() and reduce the grass sprite count in PushSimpleScene()
1:54:09Re-enable multisampling in OpenGLInit() and reduce the grass sprite count in PushSimpleScene()
1:54:09Re-enable multisampling in OpenGLInit() and reduce the grass sprite count in PushSimpleScene()
1:54:51Run the game, and compare the edge rendering with and without multisampling
🏃
1:54:51Run the game, and compare the edge rendering with and without multisampling
🏃
1:54:51Run the game, and compare the edge rendering with and without multisampling
🏃
1:58:03Disable pixelisation in OpenGLInit()
1:58:03Disable pixelisation in OpenGLInit()
1:58:03Disable pixelisation in OpenGLInit()
1:58:32Run the game and consider that enabled pixelisation to be a bug
🏃
1:58:32Run the game and consider that enabled pixelisation to be a bug
🏃
1:58:32Run the game and consider that enabled pixelisation to be a bug
🏃
1:58:53Switch Handmade Hero over to our abstracted renderer interface1
1:58:53Switch Handmade Hero over to our abstracted renderer interface1
1:58:53Switch Handmade Hero over to our abstracted renderer interface1
2:12:51Run both the Renderer Test and game successfully
🏃
2:12:51Run both the Renderer Test and game successfully
🏃
2:12:51Run both the Renderer Test and game successfully
🏃
2:13:28Refresh our memories as to how the mouse position is handled
📖
2:13:28Refresh our memories as to how the mouse position is handled
📖
2:13:28Refresh our memories as to how the mouse position is handled
📖
2:15:24Prevent DEBUGEnd() from calling ClipSpaceFromPixelSpace() to map the mouse coordinates
2:15:24Prevent DEBUGEnd() from calling ClipSpaceFromPixelSpace() to map the mouse coordinates
2:15:24Prevent DEBUGEnd() from calling ClipSpaceFromPixelSpace() to map the mouse coordinates
2:16:01Run the game to find that the clicking doesn't work
🏃
2:16:01Run the game to find that the clicking doesn't work
🏃
2:16:01Run the game to find that the clicking doesn't work
🏃
2:16:20Introduce ClampBinormalMapToRange() for WinMainCRTStartup() to clamp the mouse coordinates to -1 to 1 space
2:16:20Introduce ClampBinormalMapToRange() for WinMainCRTStartup() to clamp the mouse coordinates to -1 to 1 space
2:16:20Introduce ClampBinormalMapToRange() for WinMainCRTStartup() to clamp the mouse coordinates to -1 to 1 space
2:19:03Run the game to find that the mouse works again, but that the rotation and scaling controls are broken
🏃
2:19:03Run the game to find that the mouse works again, but that the rotation and scaling controls are broken
🏃
2:19:03Run the game to find that the mouse works again, but that the rotation and scaling controls are broken
🏃
2:19:31Tweak the camera rotation and zooming multipliers in UpdateAndRenderWorld()
🏃
🖮
2:19:31Tweak the camera rotation and zooming multipliers in UpdateAndRenderWorld()
🏃
🖮
2:19:31Tweak the camera rotation and zooming multipliers in UpdateAndRenderWorld()
🏃
🖮
2:21:22Change the Mouse coordinates in game_input to be one v3 called ClipSpaceMouseP
2:21:22Change the Mouse coordinates in game_input to be one v3 called ClipSpaceMouseP
2:21:22Change the Mouse coordinates in game_input to be one v3 called ClipSpaceMouseP
2:23:21Run the game to see that all is working, except for the positions of the debug system menus
🏃
2:23:21Run the game to see that all is working, except for the positions of the debug system menus
🏃
2:23:21Run the game to see that all is working, except for the positions of the debug system menus
🏃
2:24:34Reflect on our renderer API
📖
2:24:34Reflect on our renderer API
📖
2:24:34Reflect on our renderer API
📖
2:25:47Make OpenGLChangeToSettings() responsible for setting VSync using a newly introduced PlatformOpenGLSetVSync()
2:25:47Make OpenGLChangeToSettings() responsible for setting VSync using a newly introduced PlatformOpenGLSetVSync()
2:25:47Make OpenGLChangeToSettings() responsible for setting VSync using a newly introduced PlatformOpenGLSetVSync()
2:29:58Run the game and the Renderer Test to gauge the VSync
🏃
2:29:58Run the game and the Renderer Test to gauge the VSync
🏃
2:29:58Run the game and the Renderer Test to gauge the VSync
🏃
2:31:34Run the Renderer Test in -Od to see that we do request that VSync is disabled
🏃
2:31:34Run the Renderer Test in -Od to see that we do request that VSync is disabled
🏃
2:31:34Run the Renderer Test in -Od to see that we do request that VSync is disabled
🏃
2:32:20Q&A
🗩
2:32:20Q&A
🗩
2:32:20Q&A
🗩
2:32:47Reflect again on our cleaner renderer API
📖
2:32:47Reflect again on our cleaner renderer API
📖
2:32:47Reflect again on our cleaner renderer API
📖
2:33:45ivereadthesequel Q: Don't know if you've answered this before, but why do you make all of your functions internal? Some in chat were saying that doesn't seem to make sense in a unity build, but I'm just wondering for your general case
🗪
2:33:45ivereadthesequel Q: Don't know if you've answered this before, but why do you make all of your functions internal? Some in chat were saying that doesn't seem to make sense in a unity build, but I'm just wondering for your general case
🗪
2:33:45ivereadthesequel Q: Don't know if you've answered this before, but why do you make all of your functions internal? Some in chat were saying that doesn't seem to make sense in a unity build, but I'm just wondering for your general case
🗪
2:36:51vateferfout Q: Not important, but I think that in your LoadBMP() function you're still declaring a renderer_texture result
🗪
2:36:51vateferfout Q: Not important, but I think that in your LoadBMP() function you're still declaring a renderer_texture result
🗪
2:36:51vateferfout Q: Not important, but I think that in your LoadBMP() function you're still declaring a renderer_texture result
🗪
2:37:29rationalcoder Q: Is there something about your render passes that prohibits hybrid AA techniques, like MSAA 4X plus conservative FXAA? MSAA 16X is way overkill
🗪
2:37:29rationalcoder Q: Is there something about your render passes that prohibits hybrid AA techniques, like MSAA 4X plus conservative FXAA? MSAA 16X is way overkill
🗪
2:37:29rationalcoder Q: Is there something about your render passes that prohibits hybrid AA techniques, like MSAA 4X plus conservative FXAA? MSAA 16X is way overkill
🗪
2:40:33Reduce MaxMultiSampleCount in OpenGLInit()
2:40:33Reduce MaxMultiSampleCount in OpenGLInit()
2:40:33Reduce MaxMultiSampleCount in OpenGLInit()
2:41:00Run the game to gauge our multisampling quality
🏃
2:41:00Run the game to gauge our multisampling quality
🏃
2:41:00Run the game to gauge our multisampling quality
🏃
2:43:50uplinkcoder Q: Could you take a look at 'Typo in win32_render_test.cpp'2
🗪
2:43:50uplinkcoder Q: Could you take a look at 'Typo in win32_render_test.cpp'2
🗪
2:43:50uplinkcoder Q: Could you take a look at 'Typo in win32_render_test.cpp'2
🗪
2:44:06Fix typo in PushSimpleScene()
2:44:06Fix typo in PushSimpleScene()
2:44:06Fix typo in PushSimpleScene()
2:45:16Rounin Q: The plants look worse with 8-bit
🗪
2:45:16Rounin Q: The plants look worse with 8-bit
🗪
2:45:16Rounin Q: The plants look worse with 8-bit
🗪
2:46:03centhusiast Q: Have we used the malloc from CRT or have we always used Windows alloc? Is it okay to use the malloc in the game?
🗪
2:46:03centhusiast Q: Have we used the malloc from CRT or have we always used Windows alloc? Is it okay to use the malloc in the game?
🗪
2:46:03centhusiast Q: Have we used the malloc from CRT or have we always used Windows alloc? Is it okay to use the malloc in the game?
🗪
2:47:39ivereadthesequel Q: On "internal": sorry, I was just wondering on a more fundamental level. I only knew it makes that function only accessible from that translation unit (I may have this wrong), and I wanted to know what it did for you in general, not just in response to the unity build part. Or is that really all it does?
🗪
2:47:39ivereadthesequel Q: On "internal": sorry, I was just wondering on a more fundamental level. I only knew it makes that function only accessible from that translation unit (I may have this wrong), and I wanted to know what it did for you in general, not just in response to the unity build part. Or is that really all it does?
🗪
2:47:39ivereadthesequel Q: On "internal": sorry, I was just wondering on a more fundamental level. I only knew it makes that function only accessible from that translation unit (I may have this wrong), and I wanted to know what it did for you in general, not just in response to the unity build part. Or is that really all it does?
🗪
2:51:34We're all good3,4
🗩
2:51:34We're all good3,4
🗩
2:51:34We're all good3,4
🗩