• Advertisement
Sign in to follow this  

Changing settings after initialization

This topic is 1927 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

I am Initializing directx in this way:

[source lang="cpp"] D3DPRESENT_PARAMETERS d3dpp;

LPDIRECT3D9 g_pD3D = NULL;


if( NULL == ( g_pD3D = Direct3DCreate9( D3D_SDK_VERSION ) ) )
return false;

ZeroMemory( &d3dpp, sizeof(d3dpp) );

d3dpp.Windowed = true;
d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
d3dpp.BackBufferFormat = D3DFMT_A8R8G8B8;
d3dpp.AutoDepthStencilFormat = D3DFMT_D16;
d3dpp.BackBufferCount = 1;
d3dpp.MultiSampleQuality = 0;
d3dpp.hDeviceWindow = hwnd;
d3dpp.EnableAutoDepthStencil = true;
d3dpp.AutoDepthStencilFormat = D3DFMT_D24S8;
d3dpp.Flags = 0;
d3dpp.FullScreen_RefreshRateInHz = D3DPRESENT_RATE_DEFAULT;
d3dpp.MultiSampleType = D3DMULTISAMPLE_8_SAMPLES;
//d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;

if( FAILED( g_pD3D->CreateDevice( D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hwnd,
D3DCREATE_SOFTWARE_VERTEXPROCESSING,
&d3dpp, &g_D3DDevice ) ) )[/source]
Now how can I change after initialization my settings (for example MultiSampleType)? Sorry for stupid question.

Share this post


Link to post
Share on other sites
Advertisement
Before you can reset DirectX9 device you need to release all buffers, textures, shaders, etc (unless they're created using MANAGED pool), otherwise Reset() call will fail.

Share this post


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

  • Advertisement