I asked this question in a replying message, but no one reply me :(
I'm appreciate if anyone tell me where I can find the DirectX include file for asm, no matter which version DirectX it's for.

Thanks
Posted on 2004-02-10 03:20:28 by KomsBomb
Some old TASM file i use for reference about directdraw DX 6.1

http://www.hostileencounter.com/tdx61inc.zip

i generally extract what i need from .h files and add them to my project on a need to do basis
so i do not have a complete include file

the link might die in the future
Posted on 2004-02-10 03:50:16 by BogdanOntanu
Thank you very much, Bogdan,
Seems these include files are far away from the OOP or COM, but I think they are enough for me.
I don't want to develop complex DX program, I only need very little. The methods offset is enough for me.

Thank you.
Posted on 2004-02-10 04:00:39 by KomsBomb
Well OOP and COM are just that: "offsets into an vtable/structure"

Check the downloaded file name since i have changed it with a more cmpletel version 1 minut after my first message...

However if you have downloaded it later tham 1 minute then it is the right (complete) file that i have
Posted on 2004-02-10 04:11:04 by BogdanOntanu
Well, actually I am building my own DX7 includes, that are OOP-oriented. I need them to be so, because my own IDE ("TIX") has intellisense for this stuff :), and my OOP framework does everything very easily.


[color=green];---------[ .nfo ]-----------------\
; DirectSound7 for ATC
; Ultrano
; Microsoft
;----------------------------------/[/color]

[color=blue]IID_IDirectSound:[/color]
dd 279AFA83h
dw 04981h,011CEh
db 0A5h,021h,0,020h,0AFh,0Bh,0E5h,060h
EnterHostedClass [color=green]; hehe[/color]

[color=blue]class[/color] IDirectSound,,COM compatible
virtual QueryInterface:riid,ppvObj
virtual AddRef:
virtual Release:

virtual CreateSoundBuffer
virtual GetCaps
virtual DuplicateSoundBuffer
virtual SetCooperativeLevel
virtual Compact
virtual GetSpeakerConfig
virtual SetSpeakerConfig
virtual Initialize
[color=blue]endclass[/color]

[color=blue]class[/color] IDirectSoundBuffer,,COM compatible
virtual QueryInterface:riid,ppvObj
virtual AddRef:
virtual Release:

virtual GetCaps
virtual GetCurrentPosition
virtual GetFormat
virtual GetVolume
virtual GetPan
virtual GetFrequency
virtual GetStatus
virtual Initialize
virtual Lock
virtual Play
virtual SetCurrentPosition
virtual SetFormat
virtual SetVolume
virtual SetPan
virtual SetFrequency
virtual Stop
virtual Unlock
virtual Restore

[color=blue]endclass[/color]

[color=blue]class[/color] IDirectSoundCapture,,COM compatible
virtual QueryInterface:riid,ppvObj
virtual AddRef:
virtual Release:
virtual CreateCaptureBuffer
virtual GetCaps
virtual Initialize
[color=blue]endclass
class[/color] IDirectSoundCaptureBuffer,,COM compatible
virtual QueryInterface:riid,ppvObj
virtual AddRef:
virtual Release:
virtual GetCaps
virtual GetCurrentPosition
virtual GetFormat
virtual GetStatus
virtual Initialize
virtual Lock
virtual Start
virtual Stop
virtual Unlock
[color=blue]endclass[/color]


LeaveHostedClass


[color=green];=====<< Protos >>===\[/color]
DirectSoundCaptureCreate PROTO :DWORD,:DWORD,:DWORD
DirectSoundCaptureEnumerateA PROTO :DWORD,:DWORD
DirectSoundCaptureEnumerate equ <DirectSoundCaptureEnumerateA>

DirectSoundCreate PROTO :DWORD,:DWORD,:DWORD
DirectSoundEnumerateA PROTO :DWORD,:DWORD
DirectSoundEnumerate equ <DirectSoundEnumerateA>
[color=green];=======/
;=====[[ Constants >>===\[/color]
DSBCAPS_PRIMARYBUFFER equ 1
DSBCAPS_STATIC equ 2
DSBCAPS_LOCHARDWARE equ 4
DSBCAPS_LOCSOFTWARE equ 8
DSBCAPS_CTRLPOSITIONNOTIFY equ 100h
DSBCAPS_STICKYFOCUS equ 00004000h
DSBCAPS_GLOBALFOCUS equ 00008000h
DSBCAPS_GETCURRENTPOSITION2 equ 10000h
DSSCL_PRIORITY equ 2
[color=green];=======/[/color]






I also have the DirectDraw include, which is much bigger, and contains all DD interfaces. Ah , and here's some OOP code using this DSound:


.data
lpDS dd 0
set lpDS as IDirectSound
.code
[color=blue]invoke[/color] DirectSoundCreate,0,addr lpDS,0
.if eax
print "sndcard already taken"
ret
.endif
[color=blue]invoke[/color] GetDesktopWindow
[color=blue]pCall[/color] lpDS.SetCooperativeLevel,eax,DSSCL_PRIORITY
.if eax
print "can't set coop lev"
ret
.endif
[color=blue]invoke[/color] Sleep,100
[color=blue]pCall[/color] lpDS.Release
Posted on 2004-02-10 09:53:39 by Ultrano
Hi. :)

@Ultrano:
Sounds really great! Could you post it somewhere? I'm interested in learning DX, this would be a good starting point :alright:
Posted on 2004-02-10 16:34:05 by QvasiModo

Well, actually I am building my own DX7 includes, that are OOP-oriented. I need them to be so, because my own IDE ("TIX") has intellisense for this stuff :), and my OOP framework does everything very easily.

Hi, Ultrano,
Where is your OOP framework?
Maybe you've post it somewhere, but I didn't often visit here...
I've made a object model in TASM ideal mode and I've build a framework base on that too. My frame work is mainly for Win32 GUI.
Posted on 2004-02-10 19:40:52 by KomsBomb
Posted on 2004-02-11 00:24:01 by Ultrano
I'm considering translating the DX9 includes under ATC now :)
If enough people hassle me or want to help, I'll do it.
Posted on 2004-02-11 23:07:00 by Homer
I've posted a Direct3D9 include for ATCv31 and Masm over at http://homer.ultrano.com.

I have not tested it thoroughly yet, although I will be :)
Here's a little test source..

.486
.model flat, stdcall
option casemap:none


include \masm32\include\kernel32.inc
includelib \masm32\lib\kernel32.lib
include \masm32\include\windows.inc
include \masm32\include\user32.inc
includelib \masm32\lib\user32.lib

Direct3DCreate9 PROTO :DWORD
D3D_SDK_VERSION equ 31h

.data
include class.inc
include d3d9_homer.inc
includelib d3d9.lib

start:
invoke Direct3DCreate9, D3D_SDK_VERSION
.if eax==S_OK
invoke MessageBox,0,CTEXT("YAY"),0,MB_OK
.endif
invoke ExitProcess,0
end start
Posted on 2004-04-11 10:54:04 by Homer
Posted on 2004-04-12 14:45:46 by Ultrano
Hey Homer, that "yeahright.jpg" file is actually a 1.2 MB bitmap !!! :grin:
Posted on 2004-04-12 15:22:13 by QvasiModo
BIG BMP? heh - my bad :tongue:
Also, in the above test src, version of sdk should be 31, not 31h

Currently translating the MultiAnimation support classes to ATC,
along with any DX9 dependancies along the way.
Will be aiming squarely at translating the dxsdk MultiAnimation Sample
(the one with N animated instances of "Tiny.x" running around, switchable camera viewpoint, ability to control current instance of Tiny, footfall soundfx etc)

It will be good practise in my development of full Character Classes.
Just as a side note, I'm not doing this to gain any benefits of the latest SDK version, I am doing it to encourage (m)asm gamecoders, to let them know that modern asm is alive and well, and that we don't always need to relegate ourselves to obscurity, or learn the latest souped-up script language, or spend endless hours reinventing the wheel. Furthermore I believe in and fully support ATC as a strong and dependable OOP model and will continue to do so :)
Posted on 2004-04-13 02:14:21 by Homer
i code in asm since dx7.0, so i have most (all i ever needed) include files for TASM up to dx90b :)

for everyone interested: email me, cuz i cant put it anywhere...

i attach the 'dgraphics90b' include file.
Posted on 2004-05-01 20:18:47 by ti_mo_n
While this is all fine and dandy, can anyone tell me (in direct words) what the offsets for the virtual functions are.

For that matter, does anyone have a DirectX library for HLA?

Help, please.
Posted on 2004-05-02 00:35:51 by NoDot
consider the function:

IDirect3D9 *Direct3DCreate9 (UINT SDKVersion);

Return Value: If successful, this function returns a pointer to an IDirect3D9 interface; otherwise, a NULL pointer is returned.

"pointer to an IDirect3D9 interface" is actually a pointer to virtual table of all interface's methods.

let's say that it returned 100h

in my includes (attached above) u can find:

IDirect3D9_QueryInterface EQU 000000000h
IDirect3D9_AddRef EQU 000000004h
IDirect3D9_Release EQU 000000008h
IDirect3D9_RegisterSoftwareDevice EQU 00000000Ch
IDirect3D9_GetAdapterCount EQU 000000010h
IDirect3D9_GetAdapterIdentifier EQU 000000014h

etc. etc.

so:
at memory location "100h" there's a real addres to the method "Query Interface"
so u can do:


mydirect3d dd ? ;will be a pointer d3d9's virtual table
myqueryintaddress dd ? ;will be a pointer to query interface
myGetAdapterIdentifier dd ? ;will be a pointer to GetAdapterIdentifier
myadident D3DADAPTER_IDENTIFIER9 ? ;D3DADAPTER_IDENTIFIER9 structure


call Direct3DCreate9, 31 ;create d3d9
xchg ecx, eax
jecxz failed ;stop if eax == 0
mov ecx, [eax+IDirect3D9_QueryInterface]
mov edx, [eax+IDirect3D9_GetAdapterIdentifier]
mov [myqueryintaddress], ecx
mov [myGetAdapterIdentifier], edx

from now on u can easily use these methods like standard API functions:


push offset myadident
push D3DENUM_WHQL_LEVEL
push D3DADAPTER_DEFAULT
push [mydirect3d] ; this is required by COM architecture - u MUST push the pointer of the object you're
; reffering to _AS_FIRST_PARAMETER_
call [myGetAdapterIdentifier]
xchg ecx, eax
jecxz returned_S_OK

pointer to some interface is actually a pointer to Vtable. vtable is a table of pointers to actual methods.

that's all :)
Posted on 2004-05-02 07:39:01 by ti_mo_n
I wanted to use your information, but I am only going to use DirectX8. IF I try and download the DirectX9 SDK, I'll be doing it all day! I don't want to do that.

Besides, I believe I asked for an HLA example. Please give a working HLA example.
Posted on 2004-05-02 10:28:54 by NoDot
Afternoon, NoDot.

There are no directx hla examples.

Cheers,
Scronty
Posted on 2004-05-03 03:20:16 by Scronty