d3dx9/tests: Add texture coordinates and vertex colors in X file.
This commit is contained in:
parent
19abc0d0fd
commit
bbc009f452
|
@ -1994,6 +1994,30 @@ static void D3DXLoadMeshTest(void)
|
||||||
"TextureFilename { \"texture.jpg\"; }"
|
"TextureFilename { \"texture.jpg\"; }"
|
||||||
"}"
|
"}"
|
||||||
"}"
|
"}"
|
||||||
|
"MeshVertexColors {"
|
||||||
|
"8;" /* DWORD nVertexColors; */
|
||||||
|
/* array IndexedColor vertexColors[nVertexColors]; */
|
||||||
|
"0; 0.0; 0.0; 0.0; 0.0;;"
|
||||||
|
"1; 0.0; 0.0; 1.0; 0.1;;"
|
||||||
|
"2; 0.0; 1.0; 0.0; 0.2;;"
|
||||||
|
"3; 0.0; 1.0; 1.0; 0.3;;"
|
||||||
|
"4; 1.0; 0.0; 0.0; 0.4;;"
|
||||||
|
"5; 1.0; 0.0; 1.0; 0.5;;"
|
||||||
|
"6; 1.0; 1.0; 0.0; 0.6;;"
|
||||||
|
"7; 1.0; 1.0; 1.0; 0.7;;"
|
||||||
|
"}"
|
||||||
|
"MeshTextureCoords {"
|
||||||
|
"8;" /* DWORD nTextureCoords; */
|
||||||
|
/* array Coords2d textureCoords[nTextureCoords]; */
|
||||||
|
"0.0; 1.0;,"
|
||||||
|
"1.0; 1.0;,"
|
||||||
|
"0.0; 0.0;,"
|
||||||
|
"1.0; 0.0;,"
|
||||||
|
"1.0; 1.0;,"
|
||||||
|
"0.0; 1.0;,"
|
||||||
|
"1.0; 0.0;,"
|
||||||
|
"0.0; 0.0;;"
|
||||||
|
"}"
|
||||||
"}";
|
"}";
|
||||||
static const WORD box_index_buffer[] = {
|
static const WORD box_index_buffer[] = {
|
||||||
0, 1, 3,
|
0, 1, 3,
|
||||||
|
@ -2012,31 +2036,33 @@ static void D3DXLoadMeshTest(void)
|
||||||
static const struct {
|
static const struct {
|
||||||
D3DXVECTOR3 position;
|
D3DXVECTOR3 position;
|
||||||
D3DXVECTOR3 normal;
|
D3DXVECTOR3 normal;
|
||||||
|
D3DCOLOR diffuse;
|
||||||
|
D3DXVECTOR2 tex_coords;
|
||||||
} box_vertex_buffer[] = {
|
} box_vertex_buffer[] = {
|
||||||
{{0.0, 0.0, 0.0}, {-1.0, 0.0, 0.0}},
|
{{0.0, 0.0, 0.0}, {-1.0, 0.0, 0.0}, 0x00000000, {0.0, 1.0}},
|
||||||
{{0.0, 0.0, 1.0}, {-1.0, 0.0, 0.0}},
|
{{0.0, 0.0, 1.0}, {-1.0, 0.0, 0.0}, 0x1a0000ff, {1.0, 1.0}},
|
||||||
{{0.0, 1.0, 0.0}, {-1.0, 0.0, 0.0}},
|
{{0.0, 1.0, 0.0}, {-1.0, 0.0, 0.0}, 0x3300ff00, {0.0, 0.0}},
|
||||||
{{0.0, 1.0, 1.0}, {-1.0, 0.0, 0.0}},
|
{{0.0, 1.0, 1.0}, {-1.0, 0.0, 0.0}, 0x4d00ffff, {1.0, 0.0}},
|
||||||
{{1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}},
|
{{1.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, 0x66ff0000, {1.0, 1.0}},
|
||||||
{{1.0, 0.0, 1.0}, {1.0, 0.0, 0.0}},
|
{{1.0, 0.0, 1.0}, {1.0, 0.0, 0.0}, 0x80ff00ff, {0.0, 1.0}},
|
||||||
{{1.0, 1.0, 0.0}, {0.0, 1.0, 0.0}},
|
{{1.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, 0x99ffff00, {1.0, 0.0}},
|
||||||
{{1.0, 1.0, 1.0}, {0.0, 1.0, 0.0}},
|
{{1.0, 1.0, 1.0}, {0.0, 1.0, 0.0}, 0xb3ffffff, {0.0, 0.0}},
|
||||||
{{0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}},
|
{{0.0, 1.0, 0.0}, {0.0, 1.0, 0.0}, 0x3300ff00, {0.0, 0.0}},
|
||||||
{{0.0, 1.0, 1.0}, {0.0, 1.0, 0.0}},
|
{{0.0, 1.0, 1.0}, {0.0, 1.0, 0.0}, 0x4d00ffff, {1.0, 0.0}},
|
||||||
{{1.0, 1.0, 0.0}, {1.0, 0.0, 0.0}},
|
{{1.0, 1.0, 0.0}, {1.0, 0.0, 0.0}, 0x99ffff00, {1.0, 0.0}},
|
||||||
{{1.0, 1.0, 1.0}, {1.0, 0.0, 0.0}},
|
{{1.0, 1.0, 1.0}, {1.0, 0.0, 0.0}, 0xb3ffffff, {0.0, 0.0}},
|
||||||
{{0.0, 0.0, 1.0}, {0.0, -1.0, 0.0}},
|
{{0.0, 0.0, 1.0}, {0.0, -1.0, 0.0}, 0x1a0000ff, {1.0, 1.0}},
|
||||||
{{0.0, 0.0, 0.0}, {0.0, -1.0, 0.0}},
|
{{0.0, 0.0, 0.0}, {0.0, -1.0, 0.0}, 0x00000000, {0.0, 1.0}},
|
||||||
{{1.0, 0.0, 0.0}, {0.0, -1.0, 0.0}},
|
{{1.0, 0.0, 0.0}, {0.0, -1.0, 0.0}, 0x66ff0000, {1.0, 1.0}},
|
||||||
{{1.0, 0.0, 1.0}, {0.0, -1.0, 0.0}},
|
{{1.0, 0.0, 1.0}, {0.0, -1.0, 0.0}, 0x80ff00ff, {0.0, 1.0}},
|
||||||
{{0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}},
|
{{0.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, 0x1a0000ff, {1.0, 1.0}},
|
||||||
{{1.0, 0.0, 1.0}, {0.0, 0.0, 1.0}},
|
{{1.0, 0.0, 1.0}, {0.0, 0.0, 1.0}, 0x80ff00ff, {0.0, 1.0}},
|
||||||
{{1.0, 1.0, 1.0}, {0.0, 0.0, 1.0}},
|
{{1.0, 1.0, 1.0}, {0.0, 0.0, 1.0}, 0xb3ffffff, {0.0, 0.0}},
|
||||||
{{0.0, 1.0, 1.0}, {0.0, 0.0, 1.0}},
|
{{0.0, 1.0, 1.0}, {0.0, 0.0, 1.0}, 0x4d00ffff, {1.0, 0.0}},
|
||||||
{{0.0, 0.0, 0.0}, {0.0, 0.0, -1.0}},
|
{{0.0, 0.0, 0.0}, {0.0, 0.0, -1.0}, 0x00000000, {0.0, 1.0}},
|
||||||
{{0.0, 1.0, 0.0}, {0.0, 0.0, -1.0}},
|
{{0.0, 1.0, 0.0}, {0.0, 0.0, -1.0}, 0x3300ff00, {0.0, 0.0}},
|
||||||
{{1.0, 1.0, 0.0}, {0.0, 0.0, -1.0}},
|
{{1.0, 1.0, 0.0}, {0.0, 0.0, -1.0}, 0x99ffff00, {1.0, 0.0}},
|
||||||
{{1.0, 0.0, 0.0}, {0.0, 0.0, -1.0}},
|
{{1.0, 0.0, 0.0}, {0.0, 0.0, -1.0}, 0x66ff0000, {1.0, 1.0}},
|
||||||
};
|
};
|
||||||
static const D3DXMATERIAL box_materials[] = {
|
static const D3DXMATERIAL box_materials[] = {
|
||||||
{
|
{
|
||||||
|
@ -2060,7 +2086,7 @@ static void D3DXLoadMeshTest(void)
|
||||||
(char *)"texture.jpg", /* pTextureFilename */
|
(char *)"texture.jpg", /* pTextureFilename */
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
const DWORD box_fvf = D3DFVF_XYZ | D3DFVF_NORMAL;
|
const DWORD box_fvf = D3DFVF_XYZ | D3DFVF_NORMAL | D3DFVF_DIFFUSE | D3DFVF_TEX1;
|
||||||
/*________________________*/
|
/*________________________*/
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
HWND wnd = NULL;
|
HWND wnd = NULL;
|
||||||
|
|
Loading…
Reference in New Issue