CallCom
Posted: Tue Sep 29, 2009 5:23 pm
I was working on an old project to make it vista/windows7 ready. Everything ist working fine now, but there is an old piece of code that used CallCom to access purebasics internal directX library to change the renderstate. I was wondering if there is a way to make this work without having to install the acient CallCom lib on every new PB version. Maybe someone can help me there 
Code: Select all
#IDirect3DDevice7_SetRenderState = 20 * 4
#D3DRENDERSTATE_CULLMODE = 22
#D3DCULL_NONE = $1
#D3DCULL_CW = $2
#D3DCULL_CCW = $3
#D3DCULL_FORCE_DWORD = $7FFFFFFF
Procedure GetD3Ddevice_interface()
Shared D3Ddevice_interface
; Fill Interface variable
!extrn _PB_Direct3D_Device
!MOV dword EAX, [_PB_Direct3D_Device]
!MOV dword [v_D3Ddevice_interface],EAX
EndProcedure
Procedure SetRenderState(a,b)
Shared D3Ddevice_interface
If D3Ddevice_interface = 0
GetD3Ddevice_interface()
EndIf
CallCOM(#IDirect3DDevice7_SetRenderState ,D3Ddevice_interface,a,b) ; Set Render-State
EndProcedure