Skip to main content
GameDev.net gamedev.net
🔒 Locked

CheckDeviceMultiSampleType

Started by Keratardon May 25, 2009 at 5:16 PM 2 replies 1.6k views
Original Post
Keratardon
Keratardon
Hi i've got a problem with the CheckDeviceMultiSampleType-methode. I want to check if my device is able to 4x MS.

        ZeroMemory(&d3dpp, sizeof(d3dpp));
	D3DDISPLAYMODE d3ddm;
	d3d->GetAdapterDisplayMode(D3DADAPTER_DEFAULT, &d3ddm);
	
	if(SUCCEEDED(d3d->CheckDeviceMultiSampleType( D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL 
, d3ddm.Format, true, D3DMULTISAMPLE_4_SAMPLES, NULL)))
	{	
	     d3dpp.MultiSampleType = D3DMULTISAMPLE_4_SAMPLES;
	}
The problem is, this check never succedes. But if i do it without the check it works fine and the object is displayd with 4x MS. So why doesn't the check succeed? I also tested this way:
 
        DWORD qualy;
        ZeroMemory(&d3dpp, sizeof(d3dpp));
	D3DDISPLAYMODE d3ddm;
	d3d->GetAdapterDisplayMode(D3DADAPTER_DEFAULT, &d3ddm);
	
	if(SUCCEEDED(d3d->CheckDeviceMultiSampleType( D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL 
, d3ddm.Format, true, D3DMULTISAMPLE_NONMASKABLE, &qualy)))
	{	
	     d3dpp.MultiSampleType = D3DMULTISAMPLE_NONMASKABLE;
             d3dpp.MultiSampleQuality = qualy;
	}
but it also didn't work. Can sombody tell me what i'm doeing wrong? Thanks
MJP
MJP
You don't want to check your adapter display mode, you want to check the format of the render target you're going to use. So if you're rendering to the backbuffer you'll want to use your backbuffer format.
Keratardon
Keratardon
I tried what you suggested but with no success.

Now it looks like :

if( SUCCEEDED(d3d->CheckDeviceMultiSampleType( D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL ,D3DFMT_A8R8G8B8, true, D3DMULTISAMPLE_4_SAMPLES, &qualy)))	{						d3dpp.MultiSampleType = D3DMULTISAMPLE_4_SAMPLES;		d3dpp.MultiSampleQuality = qualy - 1;			}


Same result, it never SUCCEEDs. But if i force it without checking it works fine.
Keratardon
Keratardon
I tried many different ways now and it seems like i'm still using this method in a wrong way. Can someone tell me what i'm doeing worng?

Or is there any other way to check if my device is able to do Antaliasing?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.