This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch master
in repository Direct3D.wiki.
View the commit online.
commit 603c3292e9fd774cde5d5ebe7194c4d097cf0590
Author: Vincent Torri <vincent.to...@gmail.com>
AuthorDate: Sat Aug 19 03:03:31 2023 -0700
Update 'Direct3D 11 for 2D: Changing the color of the triangle'
---
...-11-for-2D%3A-Changing-the-color-of-the-triangle.md | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/Direct3D-11-for-2D%3A-Changing-the-color-of-the-triangle.md b/Direct3D-11-for-2D%3A-Changing-the-color-of-the-triangle.md
index 8009bff..4e6b205 100644
--- a/Direct3D-11-for-2D%3A-Changing-the-color-of-the-triangle.md
+++ b/Direct3D-11-for-2D%3A-Changing-the-color-of-the-triangle.md
@@ -14,4 +14,20 @@ typedef struct
BYTE b;
BYTE a;
} Vertex;
-```
\ No newline at end of file
+```
+
+* Add an element in the `D3D11_INPUT_ELEMENT_DESC` array, namely `desc_ie`. This element describes how the `Vertex` structure is laying in the GPU memory:
+
+```c
+D3D11_INPUT_ELEMENT_DESC desc_ie[] =
+{
+ { "POSITION", 0, DXGI_FORMAT_R32G32_UINT, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0 },
+ { "COLOR", 0, DXGI_FORMAT_R8G8B8A8_UNORM, 0, 2 * sizeof(UINT), D3D11_INPUT_PER_VERTEX_DATA, 0 }
+};
+```
+
+which means that the first 8 bytes (R32G32) are 2 variables of type UINT (which is coherent) and the following bytes (see the 2 * sizeof(UINT)) are 4 bytes (R8G8B8A8), which represent the color components.
+
+* Add the color components to `triangle_new()` and fill the vertex accordingly.
+
+* Call `triangle_new()` with the chosen color.
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.