Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


Changing settings after initialization


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 MefistoManna   Members   -  Reputation: 139

Like
0Likes
Like

Posted 12 October 2012 - 03:33 AM

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.

Sponsor:

#2 mhagain   Crossbones+   -  Reputation: 8281

Like
0Likes
Like

Posted 12 October 2012 - 03:53 AM

Look at IDirect3DDevice9::Reset in your SDK documentation.

It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.


#3 MefistoManna   Members   -  Reputation: 139

Like
0Likes
Like

Posted 12 October 2012 - 04:51 AM

Do I have to reset my device? because if I use only this function, I get blackscreen.

#4 Ripiz   Members   -  Reputation: 529

Like
0Likes
Like

Posted 12 October 2012 - 05:12 AM

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.

#5 MefistoManna   Members   -  Reputation: 139

Like
0Likes
Like

Posted 12 October 2012 - 06:45 AM

Now I release all and it's working, thank you very much!




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS