X-Git-Url: https://git.cworth.org/git?p=apitrace-tests;a=blobdiff_plain;f=apps%2Fd3d10%2Ftri.cpp;h=737d27d589a4d37c08d3d58a8831a1318cabcba3;hp=4ea8b93e1dcd71bcf9c96c5261d29fac4e280a71;hb=e3171a80329d21614fb50990c56621b968ece117;hpb=0e029cc72de2c8e57fed0ba4eb2c2a9cc4c7a0f4 diff --git a/apps/d3d10/tri.cpp b/apps/d3d10/tri.cpp index 4ea8b93..737d27d 100644 --- a/apps/d3d10/tri.cpp +++ b/apps/d3d10/tri.cpp @@ -133,14 +133,17 @@ int main(int argc, char *argv[]){ ID3D10VertexShader * pVertexShader; hr = g_pDevice->CreateVertexShader(g_VS, sizeof g_VS, &pVertexShader); + if (FAILED(hr)) { + return 1; + } struct Vertex { float position[4]; float color[4]; }; - D3D10_INPUT_ELEMENT_DESC InputElementDescs[] = { - { "POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, offsetof(Vertex, position), D3D10_INPUT_PER_VERTEX_DATA, 0 }, + static const D3D10_INPUT_ELEMENT_DESC InputElementDescs[] = { + { "POSITION", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, offsetof(Vertex, position), D3D10_INPUT_PER_VERTEX_DATA, 0 }, { "COLOR", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, offsetof(Vertex, color), D3D10_INPUT_PER_VERTEX_DATA, 0 } }; @@ -150,6 +153,9 @@ int main(int argc, char *argv[]){ g_VS, sizeof g_VS, &pVertexLayout); + if (FAILED(hr)) { + return 1; + } g_pDevice->IASetInputLayout(pVertexLayout); @@ -178,6 +184,9 @@ int main(int argc, char *argv[]){ ID3D10Buffer *pVertexBuffer; hr = g_pDevice->CreateBuffer(&BufferDesc, NULL, &pVertexBuffer); + if (FAILED(hr)) { + return 1; + } void *pMap = NULL; pVertexBuffer->Map(D3D10_MAP_WRITE_DISCARD, 0, &pMap);