-
Notifications
You must be signed in to change notification settings - Fork 6
Renderer
Alegruz edited this page Apr 16, 2021
·
7 revisions
- Set error callback (UNIX GLFW)
- Initialize Dependencies (UNIX GLFW)
- Initialize Window
- Initialize Device
- Register Class (WIN32
WNDCLASSEX
) - Create Window
- Show Window (WIN32
ShowWindow
) - Set Callbacks (UNIX GLFW)
- Window Size
- Key
- Char
- Create D3D11 Device and Make Context Current (WIN32
D3D11CreateDevice
) - Make Context Current
- Initialize Dependencies (UNIX GL3W)
- Obtain DXGI factory from device (WIN32
IDXGIFactory*
) - Create swap chain (WIN32
DXGI_SWAP_CHAIN_DESC*
) - Create Render Target View (WIN32
CreateRenderTargetView
) - Create Depth Stencil Texture (WIN32
CreateTexture2D
) - Create Depth Stencil View (WIN32
CreateDepthStencilView
) - Set Render Targets (WIN32
OMSetRenderTargets
) - Setup Viewport (WIN32
RSSetViewport
) - Compile Shaders
-
Define, create, set the input layout (in UNIX, this is done after binding the buffers)
- WIN32
D3D11_INPUT_ELEMENT_DESC
CreateInputLayout
IASetInputLayout
- UNIX
glVertexAttribPointer
glEnableVertexAttribArray
- WIN32
- Set up Vertices and Indices
-
Create Buffer
- WIN32
CreateBuffer
- UNIX
-
glCreateBuffers
/glGenBuffer
-
- WIN32
-
Bind / Set Buffers
- WIN32
IASetVertexBuffers
IASetIndexBuffer
- UNIX
- Bind
glBindBuffer
- Store Buffers (
glNamedBufferStorage
)
- Bind
- WIN32
- Set primitive topology (WIN32
IASetPrimitiveTopology
) - Create constant buffer (WIN32
CreateBuffer
) -
Load Textures
- WIN32
CreateShaderResourceView
- UNIX
- Create Textures (
glCreateTextures
) - Bind Texture (
glBindTextureUnit
) - Get uniform location for Texture (
glGetUniformLocation
) - Set Texture Parameters (
glTextureParameter*
) - Store Texture (
glTextureStorage2D
) - Create Image (1glTextureSubImage2D`)
- Generate Mipmap (
glGenerateTextureMipmap
) - Get uniform location for Texture and set (
glUniform*
)
- Create Textures (
- WIN32
- Create sample state (WIN32
CreateSamplerState
) - Initialize matrices + inject them to constant buffers
- WIN32
-
XMMatrixIdentity()
etc
-
- WIN32
- Create Vertex Arrays (
glCreateVertexArrays
)
- Calculate transformations (WIN32)
-
Clear buffer
- WIN32
- clear back buffer
ClearRenderTargetView
- clear depth buffer
ClearDepthStencilView
- clear back buffer
- UNIX
glClearBuffer*
- WIN32
- Update variables (WIN32 feed the transformed values to the constant buffer)
-
Set Render Data
- WIN32
*SSetShader
*SSetConstantBuffers
*SSetShaderResources
*SSetSamplers
- UNIX
- Bind Texture Unit (UNIX
glBindTextureUnit
) - Bind Vertex Array (UNIX
glBindVertexArray
) - Bind Buffers (UNIX
glBindBuffer
. bind element array buffer)
- Bind Texture Unit (UNIX
- WIN32
- Render
- WIN32
-
Draw
/DrawIndexed
-
- UNIX
-
glDrawArrays
,glDrawElements
-
- WIN32
-
Swap buffers
- WIN32
gSwapChain->Present
- UNIX
glfwSwapBuffers
- WIN32