Recent

Author Topic: DirectX 10 failure with Lazarus  (Read 6532 times)

SonnyBoyXXl

  • New Member
  • *
  • Posts: 44
DirectX 10 failure with Lazarus
« 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?

BlueIcaro

  • Hero Member
  • *****
  • Posts: 576
Re: DirectX 10 failure with Lazarus
« Reply #1 on: October 07, 2013, 02:21:34 pm »
try to compile in delphi mode
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
Remenber, the lazarus wiki is your friend: http://wiki.lazarus.freepascal.org/Main_Page
General questions (several lenguages) http://wiki.lazarus.freepascal.org/

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7451
Re: DirectX 10 failure with Lazarus
« Reply #2 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

SonnyBoyXXl

  • New Member
  • *
  • Posts: 44
Re: DirectX 10 failure with Lazarus
« Reply #3 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