News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Lonewolff's DirectX 11 Library

Started by Lonewolff, March 17, 2016, 11:58:55 AM

Previous topic - Next topic

Lonewolff

Hi Guys,

I have started creating a library for DirectX 11. So, I figure this is as good a thread as any to share my progress and questions regarding this.

So far so good. I am almost at the point where I can create a D3D11 device and swapchain (D3D11CreateDeviceAndSwapChain)

I have hit a minor snag with one of the enumerations though.


DXGI_USAGE_RENDER_TARGET_OUTPUT             equ ( 1L << (1 + 4) )


This won't compile and I am wondering how I can translate this over to work in my header file?

This equates to '32', so am I safe to just hard code this instead of the syntax above? Will this have some repercussions that I am not aware of?

Thanks in advance :)

jj2007

  DXGI_USAGE_RENDER_TARGET_OUTPUT             equ 1 SHL (1 + 4)

You could use a hardcoded 32, too, unless there is a good reason for the C/C++ syntax 8)

Lonewolff

Thanks for the reply JJ.

I think I'll just hard code. I don't know why they went with ( 1L << (1 + 4) ) in the SDK. Seems like extra work when you could just write 32 - LOL.

Lonewolff

I am just looking through one of the MASM DX10 header files that are floating around these part and have a couple of questions.

*snippet from D3D10.inc


sIID_ID3D10Device = <9B7E4C0Fh,342Ch,4106h,<0A1h,9Fh,4Fh,27h,4h,0F6h,89h,0F0h>>

ID3D10Device STRUCT
  QueryInterface         DD  ;ID3D10Device.QueryInterface(This,riid,ppvObject)
  AddRef                 DD  ;ID3D10Device.AddRef(This)
  Release                 DD  ;ID3D10Device.Release(This)


Firstly what is sIID_ID3D10Device for and where did the value come from?

Secondly The functions inside the struct are defined as DWORD's, so wouldn't something like Release act as a variable instead of a function?

Last of all. How would you call these functions later on in code in ASM?

Thanks again :)

Siekmanski

That's a DX10 COM interface ID to communicate with your graphics card.

The ID3D10Device struct contain the addresses of the functions.
Now comes the fun with COM...
How to call these functions, depend on the com invoke routine used.
Creative coders use backward thinking techniques as a strategy.

Lonewolff

Damn, sounds like fun. Any advice on this would be awesome  8)

Siekmanski

Have a look at my Direct3D9 include files ( from the examples I posted ), you can use the COM interface techniques to make your own DirectX10 include files.
I assume you have downloaded the DirectX SDK.
Creative coders use backward thinking techniques as a strategy.

Zen

LONEWOLFF,
I started working on a useful translation of the DirectX version 11 COM interfaces into MASM compatible assembly language include definition files last summer.
It's a MAJOR pain-in-the-ass,...I've been doing it manually,...and, it's incredibly time consuming. I kind of lost interest because I have to write so many interface definitions before I can even begin to write an actual DirectX program. If you want, I can post some of the code that I've got so far.

SIEKMANSKI,...(above post),...has released a whole bunch of DirectX version 9 include files. He's our resident COM genius,...but, frankly,...I think he outsources the grunge work to extraterrestrials,...:bgrin:

...As I recall, there are some other threads discussing DirectX 10 files (I think that they are on the old forum).
Also, TOUTENMASM has a SDK Translator project, and he has posted numerous already-translated files (from every SDK component, including the current DirectX version),...you might want to take a look there,...it would save you alot of time,...

TouEnMasm

I could only agree with the last post ,all directx files are translated here and ready to use:
http://masm32.com/board/index.php?topic=563.msg4563#msg4563
Fa is a musical note to play with CL

Zen

By the way,...I posted a very similar question and here is the thread (from October, 2014): DirectX 11 Headers, October 2014

TouEnMasm


All .h posted are translated in the full sdk translate.
Fa is a musical note to play with CL