This repository was archived by the owner on Mar 30, 2019. It is now read-only.
This repository was archived by the owner on Mar 30, 2019. It is now read-only.
Direct2D1 RenderTarget Ambiguous Methods #803
Open
Description
I am trying to use Direct2D from VB.NET, and the RenderTarget.FillRoundedRectangle method is giving me ambiguity problems. Visual Studio says that there are 2 FillRoundedRectangle methods with the same signature differing only in passing the roundedRect parameter by value or by reference. This conflict is a difference between C# and VB.NET, and I think might be related to #456. This is both a massive pain and raises quite a few questions:
- Why do both methods exist? When would the caller want the method to change the value of the roundedRect, necessitating byref?
- I went looking at the source on GitHub to understand what each overload is doing, but not only is each function just calling another overload of the same function, the byref version of FillRoundedRectangle (and the other drawing functions) doesn't exist in the RenderTarget file. Well, I can see that the RenderTarget class is declared as partial, but GitHub search doesn't find any other definition of a "RenderTarget" class. How then can each function definition in RenderTarget.cs just call another overload of the same function? How is that not a stack overflow?
- Where is the actual code that defines the byref version of the method?
- Where does the RenderTarget drawing code - not just the FillRoundedRectangle, but all of it - actually go? Does SharpDX call into native Direct2D, or are the RoundedRectangle functions just helpers implemented in C#? If they are just helpers, I would be happy to copy the implementation myself.
Screenshot of peeking the definition of RenderTarget:
Please don't just write this off with a "SharpDX is just a C# thing" like #456.