News:

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

Starting with DirectX - A couple of problems

Started by lonewolff, July 21, 2009, 11:56:04 AM

Previous topic - Next topic

lonewolff

Hi there,

Always experimenting I am  ::)

I have taken on a few challenges here to reach this problem. But, I am sure you guru's will be able to assist.

I have started playing around with creating my own inc files and what better way to experiment than using DirectX?  :lol

I have made the following include file which appears to be ok;

D3D_SDK_VERSION equ <32>

D3DDISPLAYMODE typedef DWORD
IDirect3D9 typedef DWORD

GetAdapterDisplayMode PROTO :DWORD,:DWORD
Direct3DCreate9 PROTO :DWORD
ExitProcess PROTO :DWORD


And my main project

.386
.model flat,stdcall
option casemap:none

includelib \masm32\lib\kernel32.lib
include directx.inc
includelib D3d9.lib

.data

.data?
md3dObject IDirect3D9 ?
mode D3DDISPLAYMODE ?

.code
start:

invoke Direct3DCreate9,D3D_SDK_VERSION
mov md3dObject,eax

;md3dObject->GetAdapterDisplayMode(D3DADAPTER_DEFAULT,&mode); // C++ code
coinvoke md3dObject,IDirect3D9,GetAdapterDisplayMode,D3DADAPTER_DEFAULT,ADDR mode

invoke ExitProcess,eax

end start


Everything compiles ok until I get to the 'coinvoke' line. Where I get a syntax error md3dObject. I can't figure out why I am getting this syntax error. Can anyone help guide me to where I have gone wrong?

Thanks in advance :)

lonewolff


UtillMasm


lonewolff

Hmmm, sorry. Not sure what you are getting at there  :red

ToutEnMasm

#4
A sample to start is better
http://www.masm32.com/board/index.php?topic=7996.0
I have translated the six tutorials of directx 9.C.The last is meshes.
This samples seems to be improve now.
The translator is better now than when i write them,you can translate others with it and verify them.