CMCHTPC / DelphiDX12

DirectX 12 Headers for Delphi and FPC
92 stars 35 forks source link

Some implementations are wrong. #17

Open RBetting77 opened 4 years ago

RBetting77 commented 4 years ago

Here's one example of how the implementation is wrong.

My change works as it should.

The original declaration comes with "D2D DEBUG ERROR - An interface [0019F388] not allocated by this DLL was passed to it."

GetPixelSize is a stdcall function. stdcall pushes the parameters to the stack and returns the result in EAX. In your implementation a (semi) random value from the stack is used as the parameter, the D2D DEBUG ERROR is correct about it not being an interface allocated by this DLL.

Same goes for GetSize and GetPixelFormat in this ID2D1Bitmap interface.

RBetting77 commented 4 years ago

By editing the wrong line, committing it, fixing it and committing it again maybe the lines I marked are unclear.

Original code: function GetPixelSize(): TD2D1_SIZE_U; stdcall;

Changed code: procedure GetPixelSize(out pixelSize: TD2D1_SIZE_U); stdcall;

CMCHTPC commented 4 years ago

This is not a failure by the interface translation itself. It's an compiler issue. See here https://bugs.freepascal.org/view.php?id=34078. I'm not sure if this was already solved since the issue is still open. Delphi also has a "bug" here. I currentyl work on the update of the headers for 10.0.19041.0. So I will also try if the interface is now working or if they need a "work-around".