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

DeviceContext1.ClearView()'s 'color' parameter is of type 'float' when it should be a 'RawColor4'. #744

Closed
waltdestler opened this issue May 20, 2016 · 2 comments

Comments

@waltdestler
Copy link
Contributor

The signature for SharpDX.Direct3D11.DeviceContext1.ClearView currently looks like this:

public void ClearView(SharpDX.Direct3D11.ResourceView viewRef, float color, SharpDX.Mathematics.Interop.RawRectangle[] rectRef, int numRects)

However, that color parameter is supposed to be 4 floats, according to the docs.

I tried fixing this myself by adding this line to Mapping.xml:

<map param="ID3D11DeviceContext1::ClearView::Color" type="SharpDX.Mathematics.Interop.RawColor4" />

But this produces the following error:

fatal: in CppInterface [ID3D11DeviceContext1]/Method void ID3D11DeviceContext1::ClearView([In] ID3D11View* pView,[In] const SharpDX.Mathematics.Interop.RawColor4* Color,[In, Buffer, Optional] const RECT* pRect,[In] unsigned int NumRects) Unknown type found [SharpDX.Mathematics.Interop.RawColor4]

So I'm stumped on how to fix this. I'm happy to fix it myself and submit a pull request, but I need a tip on how to get the code generator to work.

@xoofx
Copy link
Member

xoofx commented May 20, 2016

Use the type SHARPDX_VECTOR4 as here. The type is expected to be a C++ type, not a C# type.

They are rebinded to C# type via the default mappings.

@andrewst
Copy link
Contributor

andrewst commented May 23, 2016

<map param="ID3D(\d+)DeviceContext1::ClearView::Color" type="SHARPDX_COLOR4" pointer="*" array="0"/>

@xoofx xoofx closed this as completed in d3c3608 May 30, 2016
xoofx added a commit that referenced this issue May 30, 2016
[Direct3D11] Fixed #744 DeviceContext1.ClearView()'s 'color' parameter is of type …
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

3 participants