Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8684421
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T22:18:12+00:00 2026-06-12T22:18:12+00:00

I would like to enable multisampling when drawing triangles like on the following picture:

  • 0

I would like to enable multisampling when drawing triangles like on the following picture:
enter image description here

I found a way to do with SlimDX in another question but it doesn’t work in exclusive mode.

Here is my code:

void Form1_Load(object sender, EventArgs e)
{
    Direct3D d3d = new Direct3D();

    PresentParameters presentParams;

    presentParams.Windowed = false;
    presentParams.BackBufferFormat = Format.X8R8G8B8;
    presentParams.BackBufferWidth = 800;
    presentParams.BackBufferHeight = 600;
    presentParams.FullScreenRefreshRateInHertz = 60;
    presentParams.SwapEffect = SwapEffect.Copy;
    presentParams.BackBufferCount = 1;
    presentParams.PresentationInterval = PresentInterval.One;

    int multisampleQuality;
    Result result;
    if (d3d.CheckDeviceMultisampleType(adaptor, DeviceType.Hardware, Format.X8R8G8B8, false, MultisampleType.FourSamples, out multisampleQuality, out result))
    {
        if(multisampleQuality > 4)
        {
            presentParams.Multisample = multisampleType;
            presentParams.MultisampleQuality = 4;
        }
    }

    // Device creation
    Device device = new Device(d3d, adaptor, DeviceType.Hardware, this.Handle, CreateFlags.HardwareVertexProcessing, presentParams);
}

The last line alway crashs with a D3DERR_INVALIDCALL error even if the CheckDeviceMultisampleType return always true with no error and 8 for multisampleQuality.

It works if I use the windowed mode or if I remove the multisample option.

Can someone tell me what’s wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T22:18:13+00:00Added an answer on June 12, 2026 at 10:18 pm

    Try with

     presentParams.SwapEffect = SwapEffect.Discard;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to enable antialiasing when drawing triangles like on the following picture:
I would like to enable HD video playback for my Java Swing application but
I have the following URI: Posts/{postId}/Comments/{commentId} I would like to enable users to edit
I would like to enable my wcf service with https endpoints. but I only
I would like to enable SOAP on my PHP5/Centos/Apache server. I have full access
I would like to enable users of my application to define a number of
I have a UITextField that I would like to enable auto completion on by:
I have a WPF ListBox that I would like to Enable multiple selection in
Ok, let's say that I have a button and I would like to enable/disable
I would like to know the code which can enable me to get a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.