Sign in to follow this  
djnevs

Enable anti-alias?

Recommended Posts

How do i enable anti-alias in my project? and, when its enabled, how do i set the amount of samples (2x 4x 6x) ?

Share this post


Link to post
Share on other sites
See the MultiSampleType parameter within the D3DPRESENT_PARAMETER structure. You can enable antialiasing that way:

d3dPP.MultisampleType = D3DMULTISAMPLE_2_SAMPLES

and the attribute SwapEffect musst be D3DSWAPEFFECT_DISCARD

therefore: for any change of anitialiasing parameters you have to reset the graphics device.

Share this post


Link to post
Share on other sites
You should have a present parameter object in order to create your device.

It's declaration is something like this:


PresentParameters presentParams = new PresentParameters();



Just add this before you create your device:


presentParams.SwapEffect = SwapEffect.Discard;
presentParams.MultiSample = MultiSampleType.TwoSamples;

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this