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
PracticeDx
Commits
07816a76
Commit
07816a76
authored
Apr 09, 2023
by
Administrator
Browse files
refined the cube with customized png
parent
3d3d5e78
Changes
3
Show whitespace changes
Inline
Side-by-side
PracticeDx/Ethan.png
0 → 100644
View file @
07816a76
107 KB
PracticeDx/WinMain.cpp
View file @
07816a76
...
...
@@ -66,14 +66,75 @@ struct Vertex
// create vertex buffer (8 vertices for one cube)
const
Vertex
vertices
[]
=
{
// back surface
// left bottom back
{
-
1.0
f
,
-
1.0
f
,
-
1.0
f
,
1
.0
f
,
0
.0
f
,
0.0
f
},
{
-
1.0
f
,
-
1.0
f
,
-
1.0
f
,
0
.0
f
,
1
.0
f
,
0.0
f
},
// right bottom back
{
1.0
f
,
-
1.0
f
,
-
1.0
f
,
0
.0
f
,
1.0
f
,
0.0
f
},
{
1.0
f
,
-
1.0
f
,
-
1.0
f
,
1
.0
f
,
1.0
f
,
0.0
f
},
// left top back
{
-
1.0
f
,
1.0
f
,
-
1.0
f
,
0.0
f
,
0.0
f
,
1.0
f
},
// right top back
{
1.0
f
,
1.0
f
,
-
1.0
f
,
1.0
f
,
0.0
f
,
0.0
f
},
// left surface
// left bottom front
{
-
1.0
f
,
-
1.0
f
,
1.0
f
,
0.0
f
,
1.0
f
,
1.0
f
},
// left bottom back
{
-
1.0
f
,
-
1.0
f
,
-
1.0
f
,
1.0
f
,
1.0
f
,
0.0
f
},
// left top front
{
-
1.0
f
,
1.0
f
,
1.0
f
,
0.0
f
,
0.0
f
,
0.0
f
},
// left top back
{
-
1.0
f
,
1.0
f
,
-
1.0
f
,
1.0
f
,
0.0
f
,
1.0
f
},
// right surface
// right bottom back
{
1.0
f
,
-
1.0
f
,
-
1.0
f
,
0.0
f
,
1.0
f
,
0.0
f
},
// right bottom front
{
1.0
f
,
-
1.0
f
,
1.0
f
,
1.0
f
,
1.0
f
,
1.0
f
},
// right top back
{
1.0
f
,
1.0
f
,
-
1.0
f
,
0.0
f
,
0.0
f
,
0.0
f
},
// right top front
{
1.0
f
,
1.0
f
,
1.0
f
,
1.0
f
,
0.0
f
,
1.0
f
},
// top surface
// left top back
{
-
1.0
f
,
1.0
f
,
-
1.0
f
,
0.0
f
,
1.0
f
,
1.0
f
},
// right top back
{
1.0
f
,
1.0
f
,
-
1.0
f
,
1.0
f
,
1.0
f
,
0.0
f
},
// left top front
{
-
1.0
f
,
1.0
f
,
1.0
f
,
0.0
f
,
0.0
f
,
0.0
f
},
// right top front
{
1.0
f
,
1.0
f
,
1.0
f
,
1.0
f
,
0.0
f
,
1.0
f
},
// back surface
// right bottom front
{
1.0
f
,
-
1.0
f
,
1.0
f
,
0.0
f
,
1.0
f
,
1.0
f
},
// left bottom front
{
-
1.0
f
,
-
1.0
f
,
1.0
f
,
1.0
f
,
1.0
f
,
1.0
f
},
// right top front
{
1.0
f
,
1.0
f
,
1.0
f
,
0.0
f
,
0.0
f
,
1.0
f
},
// left top front
{
-
1.0
f
,
1.0
f
,
1.0
f
,
1.0
f
,
0.0
f
,
0.0
f
},
// bottom surface
// left bottom front
{
-
1.0
f
,
-
1.0
f
,
1.0
f
,
0.0
f
,
1.0
f
,
1.0
f
},
// right bottom front
{
1.0
f
,
-
1.0
f
,
1.0
f
,
1.0
f
,
1.0
f
,
1.0
f
},
// left bottom back
{
-
1.0
f
,
-
1.0
f
,
-
1.0
f
,
0.0
f
,
0.0
f
,
0.0
f
},
// right bottom back
{
1.0
f
,
-
1.0
f
,
-
1.0
f
,
1.0
f
,
0.0
f
,
0.0
f
},
// right bottom back
{
1.0
f
,
-
1.0
f
,
-
1.0
f
,
1.0
f
,
1.0
f
,
0.0
f
},
// left top back
{
-
1.0
f
,
1.0
f
,
-
1.0
f
,
0.0
f
,
0.0
f
,
1.0
f
},
// right top back
{
1.0
f
,
1.0
f
,
-
1.0
f
,
1.0
f
,
0.0
f
,
0.0
f
},
// left bottom front
{
-
1.0
f
,
-
1.0
f
,
1.0
f
,
1.0
f
,
0.0
f
,
1.0
f
},
...
...
@@ -95,16 +156,16 @@ const unsigned short indices[] =
{
// back surface
0
,
2
,
1
,
2
,
3
,
1
,
// left surface
4
,
6
,
5
,
6
,
7
,
5
,
// right surface
1
,
3
,
5
,
3
,
7
,
5
,
8
,
10
,
9
,
10
,
11
,
9
,
// top surface
2
,
6
,
3
,
3
,
6
,
7
,
// front surface
4
,
5
,
7
,
4
,
7
,
6
,
// left surface
0
,
4
,
2
,
2
,
4
,
6
,
12
,
14
,
13
,
14
,
15
,
13
,
// back surface
16
,
18
,
17
,
18
,
19
,
17
,
// bottom surface
0
,
1
,
4
,
1
,
5
,
4
,
2
0
,
22
,
21
,
22
,
23
,
21
,
};
/************************************
...
...
@@ -993,7 +1054,7 @@ int WINAPI WinMain(HINSTANCE hInstance,
InitD3D
(
hWnd
);
// test texture load
std
::
string
imageFile
=
"
oasis.ico
"
;
std
::
string
imageFile
=
"
Ethan.png
"
;
std
::
wstring
wsImageFile
=
std
::
wstring
(
imageFile
.
begin
(),
imageFile
.
end
());
BYTE
*
imageData
;
int
bytesPerRow
=
8
;
...
...
PracticeDx/yueyue.png
0 → 100644
View file @
07816a76
220 KB
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