Here's a small example showing that my ATC-based DX9 includes are working.
The example application creates itself a main window, then it creates an IDirect3D9 object, then calls IDirect3D9::CreateDevice to tell D3D that it should render to the window we created... in other words, basic D3D9 initialisation is performed. Nothing new or cool in this sourcecode, I'm hoping this posting will draw attention to my work with D3D9, possibly breathing new life into this tired looking forum...

This source is a "bare bones" application model, unless I see more interest in the D3D9 stuff, I'm afraid I will discontinue work on the dependant classes (stuff like CD3DApplication framework).

PS: Seems we don't have to package the msvcvr70.dll with our DX apps under DX9, my executable runs from the zip without a problem !!
Posted on 2004-06-02 00:25:23 by Homer
Small update to sourcecode provided:
The attached source now performs basic Rending , and is polling the Device CooperativeLevel in preparation for dynamic unloading/reloading of device-dependant resources (we don't have any yet).
Posted on 2004-06-02 00:57:53 by Homer
Please let me know if you have a problem compiling the provided sourcecode, I'd like to crush any build-time issues right now.
(I remember how many people had issues building under DX8 variants, we don't want to repeat that fiasco, do we?)
Posted on 2004-06-02 01:32:17 by Homer
Another small addition to the posted example..
The source was cleaned up a little, some stuff moved around, support for the DX Helper Lib was added, in particular D3DXTexture functions are now available.
The example attempts to load a texture from a JPG file (successfully).

NOTE:
Application size blows out from 4.5kb to 345kb ONLY due to the extra lib(s) linked by including the DXHelper lib
Posted on 2004-06-02 02:32:08 by Homer
Its the helper lib that stopped any more attempts at DX9 for me. I'll look at your source.

I cannot see the image. Geforce 2 card. No failure warning. DX9 SDK summer update.
Posted on 2004-06-02 05:00:52 by ThoughtCriminal
Afternoon, EvilHomer2k.

include \masm32\include\macros.inc
Not there. Should be:
include macros.inc

include include\d3d9_homer.inc
Not there. Should be:
include d3d9_homer.inc

Ditto for:
d3d9types.inc
and
d3dx9tex.inc

Maybe a ReadMe.txt should be included to tell people what files are required (and where) and where any extra supplied files should go?

Cheers,
Scronty
Posted on 2004-06-02 06:50:26 by Scronty
Yep, the zip I uploaded contains no file path information, my mistake, I'll watch that in future.
Aside from that, no problems?
Posted on 2004-06-02 08:29:43 by Homer
Just added a little code to create a VB and fill it with some vertices (rhw, for textured quad demo), nothing renders .. but then, I've NEVER managed to get rhw vertices to render, so I'll rework it tomorrow. In the meantime, here is the latest code, can anyone see why my textured quad is not rending?
Posted on 2004-06-02 10:47:44 by Homer
Afternoon, EvilHomer2k.

This current file loads LoadMe.png while the supplied image is LoadMe.jpg .

Cheers,
Scronty
Posted on 2004-06-02 18:08:29 by Scronty
Yep, I altered the filename and filetype because I wasn't sure if DX supported that format natively (it does).
Note that I am not using any transform matrices in this example.
I have been led to believe that we don't need to set a view matrix or projection matrix for a simple rhw quad - there's no perspective being applied.

Is this assumption correct ?
Posted on 2004-06-02 21:42:33 by Homer
Afternoon, EvilHomer2k.

I've done a little tinkering and as far as I can tell you cannot use texture coordinates on xyzrhw vertices. This means that you'd have to create the view/world/projection matrices as well.

Attached is the vertice example slightly adjusted so that it displays a simple triangle using xyzrhw. This is almost identical to the Vertices example in the DX9SDK.

I also found an error for SetLight in one of your include files and corrected accordingly.

If you want to get a few examples of using DX9 up-n-running quickly it might be an idea to just convert the DX8 examples I've already done (or I could do them if you'd prefer).

Just as with the DX8 include files, we'd need quite a few examples to be able to find the errors in the include files.

Cheers,
Scronty
Posted on 2004-06-02 23:15:13 by Scronty
Thanks for showing interest, I deliberately have avoided pasting wads of source from the DX8 includes in an effort to avoid the issues I'm sure are still lurking in those headers from the transition from 8.0 to 8.1, I simply refer back to them where suitable. If I hadn't bothered, I'd have missed a bunch of new equates, and I'm sure I'd have defined the interfaces incorrectly due to changes in function params.
I'll take a look at your posting now, just wanted to comment that my rhw rectangle is 2xrhw triangles, so I'm looking forward to seeing where I went wrong there... incidentally, I based that example on source provided at http://www.drunkenhyena.com/cgi-bin/view_article.pl?article=18, which contains NO references to a view matrix or anything like that - in fact, there's a dozen or so examples which lead up to usage of view and proj matrices... monkey see, monkey do.

I've just evaluated the modifications you have made.
Out of curiosity, which IDE do you use?
Posted on 2004-06-02 23:33:28 by Homer
Afternoon, EvilHomer2k.

QEditor.

However I've started playing around with subclassing a RichEdit control to allow decent selection of words by doubleclicking (i.e. doubleclicking on WM_SIZE in "WM_SIZE == uMsg" will select "WM_SIZE" - not "WM" or "SIZE<space>" ).

/me downloading DH tutorial to see how he's done it

Cheers,
Scronty

Cheers,
Scronty
Posted on 2004-06-03 00:09:55 by Scronty
Afternoon, EvilHomer2k.

Got it working.

Download from:
http://www.scrontsoft.com/Axis_n_Allies/testing.zip

Dunno what was being done wrong beforehand :confused: .

Cheers,
Scronty
Posted on 2004-06-03 02:06:43 by Scronty
Great, I'll check it out now :)
I was asking about ide because of the formatting of comments in your recent source.
Ultrano's "tix" ide uses "marker comments" like that which can be used within the ide to hide and unhide that codeblock... I use qeditor.
Posted on 2004-06-05 21:07:34 by Homer
Odd, I can't see anything different ! Ah well, it's working :)
Posted on 2004-06-05 21:28:24 by Homer
In the attached example, I have wrapped the textured 2D quad functionality in a class I have called My2DPanel. It can be used to create any number of 2D panels on the screen, useful for all kinds of things, especially for fixed overlays rendered on top of whatever we add later... if you wanted to just write 2D stuff, you could use this as a sprite-blitting function, or in 3D, it could be adapted for BillBoarding.

The class is an OOP class - we use the "new" macro to create new instances, so we'd create an instance for each 2D panel we wanted (I only create one here).
We save the returned "class interface pointer", and use it to call the class's LoadTexture method, passing the instance pointer as "pThis". LoadTexture loads the named texture and saves the texture's pointer within a data field of the current instance (pThis). Having loaded the texture, we set up a RECT structure with the screen coordinates we'd like for our Panel, and call the SetRect method, which sets up the VertexBuffer values.
From our main Render loop, we call the class's Render method, again passing the instance pointer as pThis, since that's the instance we'd like to Render.

Changed image to jpg to evade board filesize limit.
Posted on 2004-06-06 05:13:29 by Homer
I have been led to believe that we don't need to set a view matrix or projection matrix for a simple rhw quad - there's no perspective being applied.


There is nothing applied, the vertices are fed to the rasterizer as-is.

I've done a little tinkering and as far as I can tell you cannot use texture coordinates on xyzrhw vertices


You can, just create the proper struct and proper FVF format (or vertex declaration). You cannot use texture matrices though, afaik. Note that backface culling still works (this is done in screenspace by the hardware, not in objectspace as you would do in a software renderer). I created many filter routines this way, using multitexturing and fullscreen quads.
Posted on 2004-06-06 05:20:53 by Scali
Thanks Scali, I'm having more success, I was correct thinking the way I was thinking, Scronty fixed the render issue (I have no idea what was wrong - it looked identical to me), now I've reworked it in my previous posting with a supporting "2d sprite blitting" class.
Posted on 2004-06-06 05:24:43 by Homer
In the attached example, I have ripped off Siekmanski's code to produce a quick 3D Mesh example - note that since I have no ZBuffer, the Tiger looks a little odd.. I was in a hurry :)
Later I'll wrap that code in a Class as I did for 2DPanels, to make it easier to load , render, manipulate and unload any number of Meshes...

Note that "earth.jpg" is not included in this zip, get it out of the previous zip I posted, I hit the board's filesize limit.
Posted on 2004-06-06 06:56:13 by Homer