Search code examples
.netgraphicsbit-manipulationdirect3dslimdx

How do I pass multiple device CreateFlags when creating a DX9 device?


I am using SlimDX(DX9) but I imagine its the same for all versions of DX. I am trying to pass both the CreateFlags.HardwareVertexProssesing and CreateFlags.Multithreaded but I can't figure out how.


Solution

  • Since they are flags, you should be able to combine them using the bit OR operator.

    CreateFlags.HardwareVertexProcessing | CreateFlags.Multithreaded
    

    Edit based on comment

    Lets say HardwareVertexProcessing = 0001 and Multithreaded = 0010

    If we OR these together we get:

    0001
    0010 OR
    ----
    0011
    

    But if we AND these, we get:

    0001
    0010 AND
    ----
    0000
    

    This link gives more detailed information. Its from the Mozilla Developer Network.