Tssss.... :twisted:
Tssss.... :twisted:
There are only 10 types of people in this world; those who understand binary and those who don't.
Thanks ! It works !
Lova ya Clootie :lol:
Hum, just a stupid question but.
Can a stdcall raise a Violation exception ?
I just put the code in the init of my app (It wasn't there before), and it crashes during a simple affectation (external to the function D3DXFillCubeTexture) but only if I have D3DXFillCubeTexture called before ...
Strange isn't it ? Or did I miss (once again) something ?
Yes, calling convention can affect your stack, so just calling function with wrong calling conventions can make your app behave like a crazy!
I don't know about your code, but this one is working correctly:
[pascal][background=#FFFFFF][normal=#000000][number=#0000FF][string=#0000FF][comment=#248F24][reserved=#000000]
type
TD3DXFill3D = procedure (out pOut: TD3DXVector4; const pTexCoord, pTexelSize: TD3DXVector3; var pData); stdcall;
function D3DXFillCubeTexture(
pCubeTexture: IDirect3DCubeTexture9;
pFunction: TD3DXFill3D;
pData: Pointer): HResult; stdcall; external d3dx9texDLL;
procedure MineFillNormalizeCubeMap(out pOut: TD3DXVector4; const pTexCoord, pTexelSize: TD3DXVector3; var pData); stdcall;
var
v: TD3DXVector3;
begin
v.x:= Abs(v.x); v.y:= Abs(v.y); v.z:= Abs(v.z);
D3DXVec3Normalize(v, pTexCoord);
pOut:= D3DXVector4(v, 1);
end;
function CMyD3DApplication.InitDeviceObjects:HRESULT;
begin
// Initialize the font's internal textures
m_pFont.InitDeviceObjects(m_pd3dDevice);
// Cube map texture creation
D3DXCreateCubeTexture(m_pd3dDevice, 128, D3DX_DEFAULT, 0, D3DFMT_A8R8G8B8, D3DPOOL_MANAGED, fCubeTexture);
D3DXFillCubeTexture(fCubeTexture, MineFillNormalizeCubeMap, nil);
D3DXSaveTextureToFile('CheckMe.dds', D3DXIFF_DDS, fCubeTexture, nil);
Result:= S_OK;
end;
[/pascal]
There are only 10 types of people in this world; those who understand binary and those who don't.
ok Thanks a lot !
It's nearly working But now I have to fix my shaders !
OK, final Delphi headers for DirectX 9 SDK Summer 2003 are out!
They contain fixes mentioned above and some others.
Also some additional samples are posted at: http://clootie.narod.ru
There are only 10 types of people in this world; those who understand binary and those who don't.
Bookmarks