Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
6749bdf6
Commit
6749bdf6
authored
Feb 27, 2014
by
Gediminas Jakutis
Committed by
Alexandre Julliard
Mar 03, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9/tests: Add a mesh test for D3DXCreateBox().
parent
cc3ec2da
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
81 additions
and
0 deletions
+81
-0
mesh.c
dlls/d3dx9_36/tests/mesh.c
+81
-0
No files found.
dlls/d3dx9_36/tests/mesh.c
View file @
6749bdf6
...
...
@@ -2424,6 +2424,85 @@ cleanup:
if
(
wnd
)
DestroyWindow
(
wnd
);
}
static
BOOL
compute_box
(
struct
mesh
*
mesh
,
float
width
,
float
height
,
float
depth
)
{
unsigned
int
i
,
face
;
static
const
D3DXVECTOR3
unit_box
[]
=
{
{
-
1
.
0
f
,
-
1
.
0
f
,
-
1
.
0
f
},
{
-
1
.
0
f
,
-
1
.
0
f
,
1
.
0
f
},
{
-
1
.
0
f
,
1
.
0
f
,
1
.
0
f
},
{
-
1
.
0
f
,
1
.
0
f
,
-
1
.
0
f
},
{
-
1
.
0
f
,
1
.
0
f
,
-
1
.
0
f
},
{
-
1
.
0
f
,
1
.
0
f
,
1
.
0
f
},
{
1
.
0
f
,
1
.
0
f
,
1
.
0
f
},
{
1
.
0
f
,
1
.
0
f
,
-
1
.
0
f
},
{
1
.
0
f
,
1
.
0
f
,
-
1
.
0
f
},
{
1
.
0
f
,
1
.
0
f
,
1
.
0
f
},
{
1
.
0
f
,
-
1
.
0
f
,
1
.
0
f
},
{
1
.
0
f
,
-
1
.
0
f
,
-
1
.
0
f
},
{
-
1
.
0
f
,
-
1
.
0
f
,
1
.
0
f
},
{
-
1
.
0
f
,
-
1
.
0
f
,
-
1
.
0
f
},
{
1
.
0
f
,
-
1
.
0
f
,
-
1
.
0
f
},
{
1
.
0
f
,
-
1
.
0
f
,
1
.
0
f
},
{
-
1
.
0
f
,
-
1
.
0
f
,
1
.
0
f
},
{
1
.
0
f
,
-
1
.
0
f
,
1
.
0
f
},
{
1
.
0
f
,
1
.
0
f
,
1
.
0
f
},
{
-
1
.
0
f
,
1
.
0
f
,
1
.
0
f
},
{
-
1
.
0
f
,
-
1
.
0
f
,
-
1
.
0
f
},
{
-
1
.
0
f
,
1
.
0
f
,
-
1
.
0
f
},
{
1
.
0
f
,
1
.
0
f
,
-
1
.
0
f
},
{
1
.
0
f
,
-
1
.
0
f
,
-
1
.
0
f
}
};
static
const
D3DXVECTOR3
normals
[]
=
{
{
-
1
.
0
f
,
0
.
0
f
,
0
.
0
f
},
{
0
.
0
f
,
1
.
0
f
,
0
.
0
f
},
{
1
.
0
f
,
0
.
0
f
,
0
.
0
f
},
{
0
.
0
f
,
-
1
.
0
f
,
0
.
0
f
},
{
0
.
0
f
,
0
.
0
f
,
1
.
0
f
},
{
0
.
0
f
,
0
.
0
f
,
-
1
.
0
f
}
};
if
(
!
new_mesh
(
mesh
,
24
,
12
))
{
return
FALSE
;
}
width
/=
2
.
0
f
;
height
/=
2
.
0
f
;
depth
/=
2
.
0
f
;
for
(
i
=
0
;
i
<
24
;
i
++
)
{
mesh
->
vertices
[
i
].
position
.
x
=
width
*
unit_box
[
i
].
x
;
mesh
->
vertices
[
i
].
position
.
y
=
height
*
unit_box
[
i
].
y
;
mesh
->
vertices
[
i
].
position
.
z
=
depth
*
unit_box
[
i
].
z
;
mesh
->
vertices
[
i
].
normal
.
x
=
normals
[
i
/
4
].
x
;
mesh
->
vertices
[
i
].
normal
.
y
=
normals
[
i
/
4
].
y
;
mesh
->
vertices
[
i
].
normal
.
z
=
normals
[
i
/
4
].
z
;
}
face
=
0
;
for
(
i
=
0
;
i
<
12
;
i
++
)
{
mesh
->
faces
[
i
][
0
]
=
face
++
;
mesh
->
faces
[
i
][
1
]
=
face
++
;
mesh
->
faces
[
i
][
2
]
=
(
i
%
2
)
?
face
-
4
:
face
;
}
return
TRUE
;
}
static
void
test_box
(
IDirect3DDevice9
*
device
,
float
width
,
float
height
,
float
depth
)
{
HRESULT
hr
;
ID3DXMesh
*
box
;
struct
mesh
mesh
;
char
name
[
256
];
hr
=
D3DXCreateBox
(
device
,
width
,
height
,
depth
,
&
box
,
NULL
);
ok
(
hr
==
D3D_OK
,
"Got result %x, expected 0 (D3D_OK)
\n
"
,
hr
);
if
(
hr
!=
D3D_OK
)
{
skip
(
"Couldn't create box
\n
"
);
return
;
}
if
(
!
compute_box
(
&
mesh
,
width
,
height
,
depth
))
{
skip
(
"Couldn't create mesh
\n
"
);
box
->
lpVtbl
->
Release
(
box
);
return
;
}
mesh
.
fvf
=
D3DFVF_XYZ
|
D3DFVF_NORMAL
;
sprintf
(
name
,
"box (%g, %g, %g)"
,
width
,
height
,
depth
);
compare_mesh
(
name
,
box
,
&
mesh
);
free_mesh
(
&
mesh
);
box
->
lpVtbl
->
Release
(
box
);
}
static
void
D3DXCreateBoxTest
(
void
)
{
HRESULT
hr
;
...
...
@@ -2512,6 +2591,8 @@ static void D3DXCreateBoxTest(void)
box
->
lpVtbl
->
Release
(
box
);
test_box
(
device
,
10
.
9
f
,
20
.
0
f
,
4
.
9
f
);
end:
IDirect3DDevice9_Release
(
device
);
IDirect3D9_Release
(
d3d
);
...
...
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