X-Git-Url: https://git.cworth.org/git?p=apitrace-tests;a=blobdiff_plain;f=apps%2Fd3d10_1%2Ftri.cpp;h=2186d39411cd37bc848eecfe640e2befce5bef94;hp=3efa49b78c4c19a975b064541e21da2ccdf8af52;hb=36de802ab2d1c9c55530059595fb52a757252ff3;hpb=b3a59f4e0d7ec235cd7dd5d0b38042e5cb23d111 diff --git a/apps/d3d10_1/tri.cpp b/apps/d3d10_1/tri.cpp index 3efa49b..2186d39 100644 --- a/apps/d3d10_1/tri.cpp +++ b/apps/d3d10_1/tri.cpp @@ -34,8 +34,8 @@ #include -#include "tri_vs.h" -#include "tri_ps.h" +#include "tri_vs_4_0.h" +#include "tri_ps_4_0.h" static IDXGISwapChain* g_pSwapChain = NULL; @@ -88,6 +88,11 @@ int main(int argc, char *argv[]){ ShowWindow(hWnd, SW_SHOW); + UINT Flags = 0; + if (LoadLibraryA("d3d10sdklayers")) { + Flags |= D3D10_CREATE_DEVICE_DEBUG; + } + DXGI_SWAP_CHAIN_DESC SwapChainDesc; ZeroMemory(&SwapChainDesc, sizeof SwapChainDesc); SwapChainDesc.BufferDesc.Width = WindowWidth; @@ -105,7 +110,7 @@ int main(int argc, char *argv[]){ hr = D3D10CreateDeviceAndSwapChain1(NULL, D3D10_DRIVER_TYPE_HARDWARE, NULL, - D3D10_CREATE_DEVICE_DEBUG, + Flags, D3D10_FEATURE_LEVEL_10_0, D3D10_1_SDK_VERSION, &SwapChainDesc, @@ -212,8 +217,12 @@ int main(int argc, char *argv[]){ RasterizerDesc.CullMode = D3D10_CULL_NONE; RasterizerDesc.FillMode = D3D10_FILL_SOLID; RasterizerDesc.FrontCounterClockwise = true; + RasterizerDesc.DepthClipEnable = true; ID3D10RasterizerState* pRasterizerState = NULL; - g_pDevice->CreateRasterizerState(&RasterizerDesc, &pRasterizerState); + hr = g_pDevice->CreateRasterizerState(&RasterizerDesc, &pRasterizerState); + if (FAILED(hr)) { + return 1; + } g_pDevice->RSSetState(pRasterizerState); g_pDevice->IASetPrimitiveTopology(D3D10_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP);