Lazarus

Programming => Graphics and Multimedia => DirectX => Topic started by: SonnyBoyXXl on October 07, 2013, 12:43:45 pm

Title: DirectX 10 failure with Lazarus
Post by: SonnyBoyXXl on October 07, 2013, 12:43:45 pm
Hello together!

I'm working on a DirectX 10/11 project and was hanging for a while now at the following problem:
Code: [Select]
Result := D3DX10CreateEffectFromFile(PChar('color.fx'), TD3D10_ShaderMacro(nil^), nil, 'fx_4_0', D3D10_SHADER_ENABLE_STRICTNESS, 0,  FD3D10Device, nil, nil, m_effect, errorMessage, nil);

     m_technique := m_effect.GetTechniqueByIndex(0);
    if (m_technique = nil) then
    begin
        Result := E_FAIL;
        Exit;
    end;
    if not m_technique.IsValid then
    begin
        Result:=E_FAIL;
        exit;
    end;
    result:=m_technique.GetDesc(techniqueDesc);

    pass:=m_technique.GetPassByIndex(0);
    if not pass.IsValid then
    begin
        Result := E_FAIL;
        Exit;
    end;
    Result :=pass.GetDesc(passDesc);

When I debug, the pass.GetDesc doesn't return valid information (which I will need to create the InputLayout).

I tried this code now with Delphi XE2 and everything working fine with Delphi, so I believe now this a compiler issue. I use the JSB headers.
Can anybody help?
Title: Re: DirectX 10 failure with Lazarus
Post by: BlueIcaro on October 07, 2013, 02:21:34 pm
try to compile in delphi mode
http://www.freepascal.org/docs-html/prog/progse73.html (http://www.freepascal.org/docs-html/prog/progse73.html)
may be there some problem with de calling convetion.

I'm don't know any thing about DirectX, but you can try it

/BLueIcaro
Title: Re: DirectX 10 failure with Lazarus
Post by: marcov on October 07, 2013, 02:55:18 pm
In D2010, pchar will be a pwidechar, while in FPC it is still a PAnsichar like in  versions before D2009
Title: Re: DirectX 10 failure with Lazarus
Post by: SonnyBoyXXl on June 09, 2015, 02:37:03 pm
Hi all,

I have solved this problem now !
ORCA Interface works well. Also the Headers are now available.


https://github.com/CMCHTPC/DelphiDX12