Jump to content
  • Advertisement
Sign in to follow this  
Belkacem

DXGI_SWAP_CHAIN_FLAG_GDI_COMPATIBLE flag

This topic is 2837 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hello

after i googled for id3dxfont in d3d11 i find id3dxfont die in this version and the solution is to use

DXGI_SWAP_CHAIN_FLAG_GDI_COMPATIBLE flag

but when i use this flag
the D3D11CreateDeviceAndSwapChain () return E_FAIL.

but if pass NULL falg i get S_OK .

any help

her is the code



_Number_Feature_Level_List = ARRAYSIZE (Feature_Level_List);
_Swp_Chain_desc.BufferCount = 1 ;
_Swp_Chain_desc.BufferDesc .Format = _Mode_Desc->Format ;
_Swp_Chain_desc.BufferDesc .Height = _Height;
_Swp_Chain_desc.BufferDesc .RefreshRate = _Mode_Desc->RefreshRate ;
_Swp_Chain_desc.BufferDesc .Scaling = _Mode_Desc->Scaling ;
_Swp_Chain_desc.BufferDesc .ScanlineOrdering = _Mode_Desc->ScanlineOrdering ;
_Swp_Chain_desc.BufferDesc .Width = _Width ;
_Swp_Chain_desc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT ;
_Swp_Chain_desc.OutputWindow = hwnd ;
_Swp_Chain_desc.SampleDesc = _Sapmle_Desc;
_Swp_Chain_desc.SwapEffect = DXGI_SWAP_EFFECT_DISCARD ;
_Swp_Chain_desc.Windowed = Windowed ;
_Swp_Chain_desc.Flags = DXGI_SWAP_CHAIN_FLAG_GDI_COMPATIBLE ;

if ( FAILED (D3D11CreateDeviceAndSwapChain ( NULL , D3D_DRIVER_TYPE_HARDWARE , NULL , D3D11_CREATE_DEVICE_SINGLETHREADED, Feature_Level_List
,_Number_Feature_Level_List , D3D11_SDK_VERSION , &_Swp_Chain_desc, &_SwapChain, &_Device ,&_featureLevel , &_DeviceContext )))


{
return E_FAIL ;
exit(0);
}

Share this post


Link to post
Share on other sites
Advertisement
ok guys i have modified code little


i use D3D11createdevice ()


after that i create swap chain like this




_Number_Feature_Level_List = ARRAYSIZE (Feature_Level_List);
_Swp_Chain_desc.BufferCount = 1 ;
_Swp_Chain_desc.BufferDesc .Format = _Mode_Desc->Format ;
_Swp_Chain_desc.BufferDesc .Height = _Height;
_Swp_Chain_desc.BufferDesc .RefreshRate = _Mode_Desc->RefreshRate ;
_Swp_Chain_desc.BufferDesc .Scaling = _Mode_Desc->Scaling ;
_Swp_Chain_desc.BufferDesc .ScanlineOrdering = _Mode_Desc->ScanlineOrdering ;
_Swp_Chain_desc.BufferDesc .Width = _Width ;
_Swp_Chain_desc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT ;
_Swp_Chain_desc.OutputWindow = hwnd ;
_Swp_Chain_desc.SampleDesc = _Sapmle_Desc;
_Swp_Chain_desc.SwapEffect = DXGI_SWAP_EFFECT_DISCARD ;
_Swp_Chain_desc.Windowed = Windowed ;
_Swp_Chain_desc.Flags = DXGI_SWAP_CHAIN_FLAG_GDI_COMPATIBLE ;




D3D11CreateDevice ( NULL , D3D_DRIVER_TYPE_HARDWARE , NULL , D3D11_CREATE_DEVICE_SINGLETHREADED, Feature_Level_List
,_Number_Feature_Level_List , D3D11_SDK_VERSION , &_Device ,&_featureLevel , &_DeviceContext ); // return S_OK


_Factory->CreateSwapChain ( _Device , &_Swp_Chain_desc , &swpchain); //// return E_FAIL ;




any help or suggest

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!