News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Special Pointer Call thingy

Started by RedXVII, April 17, 2006, 07:01:56 PM

Previous topic - Next topic

RedXVII

C code;

gD3dDevice->Clear(0,NULL,D3DCLEAR_TARGET,D3DCOLOR_XRGB(0,0,0),1.0f,0);

My code atm;

dxcall gD3dDevice, D3DDClear, 0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0,0,0), f1p0, 0

where dxcall is nicely set up:

dxcall MACRO p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15,p16,p17,p18,p19,p20
mov eax, p1
for arg,<p20,p19,p18,p17,p16,p15,p14,p13,p12,p11,p10,p9,p8,p7,p6,p5,p4,p3>
ifnb <arg>
push arg
endif
endm
push eax
mov eax, [eax]
call dword ptr [eax+p2]
endm


I want to know if theres a better way of doing this that im overlooking. Because my include file is set up like,

D3DD9QueryInterface equ 00h
D3DD9AddRef equ 04h
D3DD9Release equ 08h
D3DD9TestCooperativeLevel equ 0Ch
D3DD9GetAvailableTextureMem equ 010h
D3DD9EvictManagedResources equ 014h
D3DD9GetDirect3D equ 018h
...


Now; it can be mightily inconvenient to type out the D3D9 bits in front, but thats my solution for this so far :(

Perhaps a method set up for something like...

dxcall gD3dDevice.Clear, 0, ...

I am unsure how to do that though. Wouldnt i have to let the assembler know what type of structure it pointed to?

Im open to any suggestions i could use here, perhaps theres some masm syntax ive overooked or havent learned yet?

Thanks very much  :U

Biterider

Hi
Take a look at the ICall macro (Interface Call) of the ObjAsm32 model and the interface definitions, specially those in the DirectX folder.

Biterider