Code: Select all
Direct3DCreate9(SDKVersion)
{
if !DllCall("GetModuleHandle","str",(a_windir)"\SysWOW64\d3d9", "PTR")
{
MsgBox Error Direct3DCreate9
Return
}
return DllCall((a_windir)"\SysWOW64\d3d9\Direct3DCreate9", "uint", SDKVersion)
}
IDirect3D9_CreateDevice(this,Adapter,DeviceType,hFocusWindow,BehaviorFlags,pPresentationParameters,ByRef ppReturnedDeviceInterface)
{
hr := DllCall(NumGet(NumGet(this+0)+64),"uint",this,"uint",Adapter,"uint",DeviceType,"uint",hFocusWindow,"uint",BehaviorFlags,"uint",pPresentationParameters,"uint*",ppReturnedDeviceInterface)
if hr
MsgBox Error IDirect3D9_CreateDevice
}
d3d := Direct3DCreate9("32")
VarSetCapacity(D3DPRESENT_PARAMETERS, 48+2*A_PtrSize, 0)
NumPut(1, D3DPRESENT_PARAMETERS, 0)
NumPut(1, D3DPRESENT_PARAMETERS, 4)
NumPut(1, D3DPRESENT_PARAMETERS, 24)
NumPut(1, D3DPRESENT_PARAMETERS, 24+2*A_PtrSize)
IDirect3D9_CreateDevice(d3d, 0, 1, 0, 0x00000040, &D3DP
As a workaround, I found that this is possible by getting the IDirect3DDevice9 parameter value of the already defined CreateDevice and replacing it.
If anyone knows how to implement this, please reply.