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

51 lines
3.9 KiB
Plaintext
Raw Normal View History

[video member=cmuratori stream_platform=twitch stream_username=handmade_hero project=code title="Displaying an Image with OpenGL" vod_platform=youtube id=YIOpZ9M5pc4 annotator=Miblo]
[1:13][win32_handmade.cpp: Disable PFD_DOUBLEBUFFER]
[2:04][Give it a shot and see our pink window]
[2:33][Recap our current situation]
[5:07][Blackboard: Ways of drawing quads]
[6:47][Blackboard: Using two triangles to draw our quadrilateral textures]
[7:52][win32_handmade.cpp: Explain glVertex nomenclature]
[11:08][Blackboard: Covering the screen with triangles]
[12:03][win32_handmade.cpp: Construct our first OpenGL primitive, a triangle]
[13:00][Run the game and "see" our triangle]
[14:03][Blackboard: Fixed function vs programmable pipelines]
[16:49][Blackboard: Matrix multiplication]
[20:06][Blackboard: Homogeneous coordinates and affine transforms]
[24:35][Blackboard: Model View and Projection matrices]
[26:52][win32_handmade.cpp: Use glLoadIdentity to set the MODELVIEW and PROJECTION matrices to the identity matrix]
[28:59][Run the game and see the same thing we started with]
[29:04][Blackboard: How OpenGL does Clipping]
[35:04][win32_handmade.cpp: Pass glVertex2i the unit cube and then 0.9f]
[36:11][Run the game and see the smaller rectangle]
[36:47][Blackboard: Moving from Clip space to Screen space]
[39:47][Blackboard: Drawing a texture]
[40:34][win32_handmade.cpp: Do glColor3f before the two trianges]
[42:00][Blackboard: Establishing our u,v texture coordinates]
[42:25][win32_handmade.cpp: Set our texture coordinates]
[44:17][win32_handmade.cpp: Use glTexImage2D to submit a texture to the graphics card]
[57:38][win32_handmade.cpp: Use glTexEnvi and glTexParameteri]
[1:00:16][Note that we aren't yet specifying the stride]
[1:01:14][win32_handmade.cpp: Explain these parameters]
[1:04:34][Run the game and see that we actually are there yet]
[1:04:49]["It's all a lie"][quote 354]
[1:06:17][Q&A][:speech]
[1:06:56][@ratchetfreak][You used static instead of local_persist for Init]
[1:07:04][win32_handmade.cpp: Introduce global_variable GLuint BlitTextureHandle]
[1:08:32][@nxsy][Can we verify the vsync somehow?]
[1:09:00][@SoysauceTheKid][Are there any stretching issues when going from u,v coordinates to screen coordinates? If so, how would you fix it?]
[1:09:53][@macielda][The texture name you are binding is always zero after the first iteration]
[1:10:18][@insofaras][I think in old OpenGL you don't even need glGenTextures, you can just pick your own arbitrary ints]
[1:10:31][win32_handmade.cpp: Set GlobalBlitTextureHandle = 1; rather than using glGenTextures]
[1:12:51][@robrobby][Would Texture Filtering (->GL_NEAREST) even occur when image and texture size is the same as it is now?]
[1:13:39][@garryjohanson][In your professional career what GPU library have you preferred, such as OpenGL, DirectX, GLSL, etc.? Which one do you currently use and why?]
[1:14:03][@ChronalDragon][Later on, after we upgrade to more modern OpenGL, will the game render into a framebuffer and then onto the same triangles, or will you just have it render directly to the main window buffer?]
[1:15:25][@macielda][Before you removed the Init variable and inline initialization of the texture you were always passing 0 as the name, by the way]
[1:15:56][@macielda][So there is no way to blit directly to the back buffer anymore?]
[1:17:29][@robrobby][Is there a difference in speed now we use OpenGL to move the buffer to the GPU?]
[1:19:41][@garryjohanson][Is there a way you know of to optimize PCI transfers between CPU and GPU using OpenGL?]
[1:22:39][@sssmcgrath][I dunno if this is applicable to the last question, I literally just got here, but glTexSubImage2D could be faster than glTexImage2D]
[1:23:03][Blackboard: glTexImage2D vs glTexSubImage2D]
[1:29:26][@quartertron][At what point in that chain of gl commands does the card actually get involved? Command dependent? Driver dependent?]
[1:30:02][Wrap it up][:speech]
[/video]