Skip to content
This repository has been archived by the owner on Mar 30, 2019. It is now read-only.

SharpDX.Direct3D9.SetStreamSourceFrequency #163

Closed
ghost opened this issue Sep 16, 2013 · 2 comments
Closed

SharpDX.Direct3D9.SetStreamSourceFrequency #163

ghost opened this issue Sep 16, 2013 · 2 comments

Comments

@ghost
Copy link

ghost commented Sep 16, 2013

Hello,
I have a request about the SharpDX.Direct3D9.SetStreamSourceFrequency method :

In SharpDX, this method requires 3 arguments, although in DirectX9 it requires only 2 args, with an OR operator |. I've seen that the method exists in SharpDX with two args, but internal.

I have a problem with the 3 args method because in the MSDN it is specified that at the end of rendering the frequency must be turned off liek this :

pd3dDevice->SetStreamSourceFreq(0,1);
pd3dDevice->SetStreamSourceFreq(1,1); 

http://msdn.microsoft.com/en-us/library/windows/desktop/bb173349(v=vs.85).aspx

Because SharpDX is a low level API, I think developpers won't be worry about usin | operator like they would in native DirectX. Could you make the SharpDX method with two args public and add the two needed constants (in a static class for example) ?

public static class StreamSource
{
    public const int INDEX = 0x40000000;
    public const int INSTANCE = unchecked((int)0x80000000);
}

Thank you very much

@xoofx
Copy link
Member

xoofx commented Sep 16, 2013

The method ResetStreamSourceFrequency() does pd3dDevice->SetStreamSourceFreq(streamIndex,1);

The code behind the SetStreamSourceFrequency in SharpDX is doing this:

        public void SetStreamSourceFrequency(int stream, int frequency, StreamSource source)
        {
            int value = (source == StreamSource.IndexedData) ? 0x40000000 : unchecked((int)0x80000000);
            SetStreamSourceFrequency(stream, frequency | value);
        }

Which is what we would expect to simplify things. Even if SharpDX is low level, there are sometimes some API that are slightly exposed differently to simplify/clarify the API. Probably what is missing here is a proper documentation explaining to existence of ResetStreamSourceFrequency(). But this issue in itself can serve now as a documentation.

@xoofx xoofx closed this as completed Sep 16, 2013
@ghost
Copy link
Author

ghost commented Sep 16, 2013

ResetStreamSourceFrequency !!

That's exactly what I need ! Thanks !!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant