Git Product home page Git Product logo

delphidx12's People

Contributors

cmchtpc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

delphidx12's Issues

some interface Very strange!

just like:ID2D1DrawingStateBlock;
when i call m_d2dContext.SaveDrawingState(m_stateBlock);
this function crash with :
Debug Output:
D2D DEBUG ERROR - An interface [08ABDA24] not allocated by this DLL was passed to it.

also ID2D1Bitmap:
when i call GetSize().same error and crash?

why ...............?

License

Some of the pas files are licensed as GPL and others has no overal license information, which is equivalent to "all rights reserved". Are these headers free to use, or are meant only for open sourced applications?

DX12.D3D11.pas IAGetVertexBuffers how use

procedure IAGetVertexBuffers(StartSlot: UINT; NumBuffers: UINT; out ppVertexBuffers: PID3D11Buffer;
out pStrides: PUINT; out pOffsets: PUINT); stdcall;
i use this function failed

in Delphi XE8
var
pBuffers: array[0..32] of ID3D11Buffer;
pStrides: array[0..32] of UINT;
pOffsets: array[0..32] of UINT;
begin
ZeroMemory(@pBuffers,SizeOf(pBuffers));
ZeroMemory(@pStrides,SizeOf(pStrides));
ZeroMemory(@pOffsets,SizeOf(pOffsets));
g_pImmediateContext.IAGetVertexBuffers(0,32,@pBuffers[0],@pStrides[0],@pOffsets[0]);---build failed
end;

I modified to
procedure IAGetVertexBuffers(StartSlot: UINT; NumBuffers: UINT; out ppVertexBuffers: ID3D11Buffer;
out pStrides: UINT; out pOffsets: UINT); stdcall;
g_pImmediateContext.IAGetVertexBuffers(0,32,pBuffers[0],pStrides[0],pOffsets[0]);-- is ok

Params why not use "const"?

like this:

HRESULT CreateBitmapFromWicBitmap( [in] IWICBitmapSource *wicBitmapSource, [in, optional] const D2D1_BITMAP_PROPERTIES1 *bitmapProperties, [out] ID2D1Bitmap1 **bitmap );

ID2D1RenderTarget = interface(ID2D1Resource) ['{2cd90694-12e2-11dc-9fed-001143a055f9}'] function CreateBitmapFromWicBitmap(wicBitmapSource: IWICBitmapSource;bitmapProperties: PD2D1_BITMAP_PROPERTIES; out bitmap: ID2D1Bitmap): HResult; stdcall;

C++ [in, optional] const<> pascal "const"?

Great work

I just dropped at CodeProject an article called "Desktop Duplication API in Delphi" which uses your headers.

IDXGIOutput1.GetDisplayModeList1 last param

MSDN
`
UINT num = 0;
DXGI_FORMAT format = DXGI_FORMAT_R32G32B32A32_FLOAT;
UINT flags = DXGI_ENUM_MODES_INTERLACED;

pOutput->GetDisplayModeList1( format, flags, &num, 0);

...

DXGI_MODE_DESC1 * pDescs = new DXGI_MODE_DESC1[num];
pOutput->GetDisplayModeList1( format, flags, &num, pDescs);
`
that mean last param [pDesc] have not [out] flag because it can be [nil] to get number of Desc array;

D2D1 color definitions

The color definitions in the D2D1Helper section are wrong.
For example:
DarkSlateGray = $2F4F4F; // >> #2F4F4F works Ok in C++, but not in Delphi
should be
DarkSlateGray = $004F4F2F; // the correct Delphi TColor equivalent to DarkSlateGray
You can check this by enter the TColorvalue to a TForm.color.
I think the colorfields r and b are mixed up in Delphi.
A correct translation from TColor to D3DCOLORVALUE:

function D2D1TColorF(dcolor: TColor; {opacity} a: Single = 1.0): TD2D1ColorF; begin Result.r := ((dcolor AND $00FF0000) shr 16) / 255; Result.g := ((dcolor AND $0000FF00) shr 8) / 255; Result.b := ((dcolor AND $000000FF)) / 255; Result.a := a; end;

inline

inline is nowdays fully supported in later versions of delphi and in freepascal.

Samples_FPC / Direct2D / WICAnimatedGIF

unit AppUnitp.as does not compile

lazarus 2.0.12 complains
AppUnit.pas(418,101) Error: Incompatible type for arg no. 1: Got "TD2D_SIZE_F", expected "PD2D1_SIZE_F"

code changes :

(starting from line 376)
var
...
...
T : TD2D1_SIZE_F; // added 2021-04-22
begin
...
...
T:= DX12.D2D1.SizeF(m_cxGifImage, m_cyGifImage);
Result := m_pHwndRT.CreateCompatibleRenderTarget( @t, nil, nil,

ID2D1BitmapRenderTarget.CreateSolidColorBrush Params Error?

MSDN:
`
HRESULT CreateSolidColorBrush(
[ref] const D2D1_COLOR_F &color,
[out] ID2D1SolidColorBrush **solidColorBrush
);

`

`
ID2D1RenderTarget = interface(ID2D1Resource)
['{2cd90694-12e2-11dc-9fed-001143a055f9}']
function CreateSolidColorBrush(const color: TD2D1_COLOR_F; {brushProperties: PD2D1_BRUSH_PROPERTIES;} out solidColorBrush: ID2D1SolidColorBrush): HResult; stdcall;

`

Wrong translation of SAL Annotations

Windows header files have SAL annotations that make the indent of the code explicit. An example of such annotation is Out_writes_bytes. See the Annotating function parameters and return values topic. The SAL annotations should be ignored.

Example: In d2d1svg.h you have:

    STDMETHOD(GetAttributeValue)(
        _In_ PCWSTR name,
        D2D1_SVG_ATTRIBUTE_POD_TYPE type,
        _Out_writes_bytes_(valueSizeInBytes) void *value,
        UINT32 valueSizeInBytes 
        ) PURE;

This is translated as:

  function GetAttributeValue(Name: PWideChar; AType: TD2D1_SVG_ATTRIBUTE_POD_TYPE; out Value: PByte;
            valueSizeInBytes: UINT32): HResult; stdcall; overload;

This should be:

function GetAttributeValue(Name: PWideChar; AType: TD2D1_SVG_ATTRIBUTE_POD_TYPE; Value: Pointer;
            valueSizeInBytes: UINT32): HResult; stdcall; overload;

The above has been tested and it works.

interface Overloaded function?

both ID2D1DeviceContext & ID2D1RenderTarget exports CreateBitmapFromWicBitmap func,
MSDN:

CreateBitmapFromWicBitmap | Overloaded.Creates a Direct2D bitmap by copying a WIC bitmap.

ID2D1DeviceContext = interface(ID2D1RenderTarget) ['{e8f7fe7a-191c-466d-ad95-975678bda998}'] function CreateBitmap(size: TD2D1_SIZE_U; sourceData: Pointer; pitch: UINT32; bitmapProperties: PD2D1_BITMAP_PROPERTIES1; out bitmap: ID2D1Bitmap1): HResult; stdcall; function CreateBitmapFromWicBitmap(wicBitmapSource: IWICBitmapSource; const bitmapProperties: TD2D1_BITMAP_PROPERTIES1; out bitmap: ID2D1Bitmap1): HResult; stdcall;**overload;**

ID2D1Bitmap.GetSize() crash?

Error Code:
D2D DEBUG ERROR - An interface [006FE67C] not allocated by this DLL was passed to it.

Process PlayerDemo.exe (8572)

Samples_FPC / Direct2D / TextAnimationSample

Under Lazarus 2.0.12 - unit TextAnimation.pas

Compiler complains "TextAnimation.pas(568,71) Error: Incompatible type for arg no. 1: Got "TD2D_SIZE_F", expected "PD2D1_SIZE_F""

Instead, code compiles and runs with
"Result := m_pRT.CreateCompatibleRenderTarget( nil, ....."

can you add XAudio2

Is it possible you can add XAudio2 headers ?
These can be found in when jah install unreal game engine .. under

C:\Program Files\Epic Games\UE_4.19\Engine\Source\ThirdParty\Windows\DirectX\include\XAudio2.h

Would be perfect to have that

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.