mD := Direct3DCreate9(D3D_SDK_Version);
ZeroMemory(@mDisplayMode, SizeOf(mDisplayMode));
md.GetAdapterDisplayMode(0,mDisplayMode);
ZeroMemory(@d3pp, SizeOf(d3pp));
d3pp.SwapEffect := Direct3D9.D3DSWAPEFFECT_DISCARD;
d3pp.hDeviceWindow :=
Handle;
d3pp.BackBufferCount := 1;
d3pp.Windowed := True;
d3pp.BackBufferWidth := mDisplayMode.Width;
d3pp.BackBufferHeight := mDisplayMode.Height;
d3pp.BackBufferFormat := mDisplayMode.Format;
d3pp.MultiSampleType := D3DMultisample_NONE;
d3pp.EnableAutoDepthStencil := False;
d3pp.PresentationInterval := D3DPresent_Interval_Default;
mResult := mD.CreateDevice(D3DADAPTER_DEFAULT,
Direct3D9.D3DDEVTYPE_HAL,
Handle,
Direct3D9.D3DCREATE_SOFTWARE_VERTEXPROCESSING,
@d3pp,mDev);
if (mDev =
nil)
then begin
ShowMessage('
Fehler beim Starten. Der Device konnte nicht erstellt werden');
exit;
end;