SUCCEEDED
Provides a generic test for success on any status value. Non-negative numbers indicate success.
获取或设置一个值,该值指示生成是否已成功。
if( SUCCEEDED( InitD3D( hWnd ) ) )
{
//显示主窗口
ShowWindow( hWnd, SW_SHOWDEFAULT );
UpdateWindow( hWnd );
//进入消息循环
MSG msg;
ZeroMemory( &msg, sizeof(msg) );
while( msg.message!=WM_QUIT )
{
if( PeekMessage( &msg, NULL, 0U, 0U, PM_REMOVE ) )
{
TranslateMessage( &msg );
DispatchMessage( &msg );
}
else
{
Render(); //渲染图形
}
}