Archived

This topic is now archived and is closed to further replies.

dMDI

Exception caused by DirectX in Delphi

Recommended Posts

dMDI    122
I downloaded the Jedi 8.1 headers from their site and started making a program in Delphi. However, when I call my DrawDirectX function, an exception is caught by the debugger in exception class C0000005 at read off address 0xffffff. My drawing code is this: procedure DrawDirectX; begin Device.Clear(0, nil, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0, 0, 0), 1.0, 0); Device.BeginScene; Device.EndScene; end; And my DirectX initialisation code is this: procedure InitialiseDirectX; var PP : TD3DPresent_Parameters; DM : TD3DDisplayMode; DT : TD3DDevTYpe; begin D3D := Direct3DCreate8(D3D_SDK_VERSION); if D3D = nil then Exit; FillChar(PP, sizeof(PP), 0); if Failed(D3D.GetAdapterDisplayMode(D3DADAPTER_DEFAULT, DM)) then Exit; PP.SwapEffect := D3DSWAPEFFECT_DISCARD; PP.BackBufferFormat := DM.Format; DT := D3DDEVTYPE_HAL; if Failed(D3D.CreateDevice(D3DADAPTER_DEFAULT, DT, Handle, D3DCREATE_SOFTWARE_VERTEXPROCESSING, PP, Device)) then Exit; end; Does anyone know what could be causing this? It is really annoying me, as I cannot draw anything to the screen! TIA. dMDI "I don''''t know with what weapons the third world war will be fought, but I know the fourth will be fought with sticks and stones." Einstein

Share this post


Link to post
Share on other sites
dMDI    122
NM, I found it.

dMDI

"I don''''t know with what weapons the third world war will be fought, but I know the fourth will be fought with sticks and stones." Einstein

Share this post


Link to post
Share on other sites