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 8dbf85e3541600be462b748439885dc85980f01d
Author: Vincent Torri <vincent.to...@gmail.com>
AuthorDate: Fri Aug 18 23:25:01 2023 -0700
Update 'Direct3D 11 for 2D: Changing the color of the triangle'
---
...D-11-for-2D%3A-Changing-the-color-of-the-triangle.md | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
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
new file mode 100644
index 0000000..8009bff
--- /dev/null
+++ b/Direct3D-11-for-2D%3A-Changing-the-color-of-the-triangle.md
@@ -0,0 +1,17 @@
+# Changing the color of the triangle
+
+As we have seen, the color of the triangle is hard coded in the pixel shader. It is possible to pass the color we want to the pixel shader, and we will do like the pixel coordinates. We need to modify the C code and the shader code. Here are the steps for the C code:
+
+* Add the four components of the BGRA color in the `Vertex` structure:
+
+```c
+typedef struct
+{
+ UINT x;
+ UINT y;
+ BYTE r;
+ BYTE g;
+ BYTE b;
+ BYTE a;
+} Vertex;
+```
\ No newline at end of file
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.