NVIDIA PerfHUD 5 first try

NVIDIA PerfHUD 5 first try
D3D Tutorial 06 : Meshes 改了下,把窗口的大小改成1024×768的

     //  Create the application's window
    HWND hWnd  =  CreateWindow(  " D3D Tutorial " " D3D Tutorial 06: Meshes "
                              WS_OVERLAPPEDWINDOW, 
100 100 1024 768 ,
                              NULL, NULL, wc.hInstance, NULL );

最主要的改动是下面,以使用PerfHud。
    UINT AdapterToUse = D3DADAPTER_DEFAULT;
    D3DDEVTYPE DeviceType
= D3DDEVTYPE_HAL;

#if  SHIPPING_VERSION
    
//  When building a shipping version, disable PerfHUD (opt-out)
#else
    
//  Look for 'NVIDIA PerfHUD' adapter
    
//  If it is present, override default settings
     for  (UINT Adapter = 0 ;Adapter < g_pD3D -> GetAdapterCount();Adapter ++ )
    {
        D3DADAPTER_IDENTIFIER9 Identifier;
        HRESULT Res;
        Res 
=  g_pD3D -> GetAdapterIdentifier(Adapter, 0 , & Identifier);
        
if  (strstr(Identifier.Description, " PerfHUD " !=   0 )
        {
            AdapterToUse
= Adapter;
            DeviceType
= D3DDEVTYPE_REF;
            
break ;
        }
    }
#endif
    
if  (FAILED(g_pD3D -> CreateDevice( AdapterToUse, DeviceType, hWnd,
        D3DCREATE_HARDWARE_VERTEXPROCESSING,
        
& d3dpp,  & g_pd3dDevice) ) )
    {
        
return  E_FAIL;
    }

点Launcher会出现个对话框,我设定快捷键为ctrl+z
NVIDIA PerfHUD 5 first try_第1张图片
把编译好的exe拖到桌面上NVIDIA PerfHUD 5 Launcher图标上(drag and drop),就能看到如下效果了。看到下图的效果后按ctrl+z就能看到激活PerfHud后的效果

NVIDIA PerfHUD 5 first try_第2张图片

你可能感兴趣的:(NVIDIA PerfHUD 5 first try)