Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Clark Lin
hw3d
Commits
61f3e9ba
Commit
61f3e9ba
authored
Feb 03, 2019
by
chili
Browse files
vertex struct organization
parent
301baa20
Changes
1
Hide whitespace changes
Inline
Side-by-side
hw3d/Graphics.cpp
View file @
61f3e9ba
...
...
@@ -104,21 +104,28 @@ void Graphics::DrawTestTriangle()
struct
Vertex
{
float
x
;
float
y
;
unsigned
char
r
;
unsigned
char
g
;
unsigned
char
b
;
unsigned
char
a
;
struct
{
float
x
;
float
y
;
}
pos
;
struct
{
unsigned
char
r
;
unsigned
char
g
;
unsigned
char
b
;
unsigned
char
a
;
}
color
;
};
// create vertex buffer (1 2d triangle at center of screen)
const
Vertex
vertices
[]
=
Vertex
vertices
[]
=
{
{
0.0
f
,
0.5
f
,
255
,
0
,
0
,
0
},
{
0.5
f
,
-
0.5
f
,
0
,
255
,
0
,
0
},
{
-
0.5
f
,
-
0.5
f
,
0
,
0
,
255
,
0
},
};
vertices
[
0
].
color
.
g
=
255
;
wrl
::
ComPtr
<
ID3D11Buffer
>
pVertexBuffer
;
D3D11_BUFFER_DESC
bd
=
{};
bd
.
BindFlags
=
D3D11_BIND_VERTEX_BUFFER
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment