flat assembler
Message board for the users of flat assembler.
Index
> Windows > d3d9 includes |
Author |
|
Madis731 31 Oct 2003, 17:58
Some wierd things happen if you try to compile the code in fASM
even with great modifications I couldn't get it to work I think you know what I mean;) |
|||
31 Oct 2003, 17:58 |
|
aaro 01 Nov 2003, 10:30
That was just to show you how to use the includes.
I will post working example when i have time to finish one. |
|||
01 Nov 2003, 10:30 |
|
aaro 01 Nov 2003, 14:24
Deleted attachment because there's bugs in files and/or fasm.
http://board.flatassembler.net/topic.php?t=481 I will post files again if i get them working. Sorry. |
|||
01 Nov 2003, 14:24 |
|
aaro 04 Nov 2003, 21:58
There's d3d9 includes and little example how to use them.
|
|||||||||||
04 Nov 2003, 21:58 |
|
Madis731 19 Nov 2003, 22:25
I have been messing around with your include file for a while. I am most thankful to you. I cleared the screen, put some vertices on it and soon I could see dots and lines and triangles. I even made a rainbow ... quite simple I think.
But the whole thing is still, now I would like to have some action I tried to convert some C++ and VBasic apps to fASM, but as I tried it, I started losing pointers, getting illegal operations and other things...strange is that when I try to change my vertices (I managed to get their pointer) they just won't change, but the next round they will be the same:| I think that vertices are copied from another location, but why and what is that location. Maybe I have missed something, but would it help if I'd rather give the application untransformed and unlit vertices. Because maybe DirectX and Windows have somekind of memory protection!? What do these EXACTLY do with the computer=> Lock() Unlock() D3DXMatrixRotationY() SetTransform() by this I mean how does RAM act before and after these functions are used... Thank you in advance, Madis |
|||
19 Nov 2003, 22:25 |
|
aaro 21 Nov 2003, 00:18
i'm very happy that someone is using my includes, hope i can help. First of all you should download dx sdk: http://www.microsoft.com/downloads/details.aspx?FamilyID=1d97f320-9dfd-4e7a-b947-3a037ccf84af&displaylang=en
Quote:
At TestD3D8.asm line 112 there's code how to copy new vertices to the vertex buffer: Code: lea eax, [.pVertices] ; EAX = Address of an local variable to get pointer to VB data D3DVB Lock, 0, sizeof.vertices, eax, 0 ; Lock VB, returns pointer to data in .pVertices(eax points to that location) .if eax,ne,D3D_OK ; Error checking xor eax, eax ; Error checking return ; Error checking .endif ; Error checking invoke RtlMoveMemory, [.pVertices], vertices, sizeof.vertices ; Copy new vertices D3DVB Unlock ; Unlock VB, copies data from .pVertices to VB(i think) You really shouldn't use the RtlMoveMemory, you should write the routine your self(faster) use rep movsd or make loop and copy data in there(faster than rep movsd on modern CPUs if i remember correctly) Quote:
Lock copies data to location where you can change it and returns pointer to it. Unlock copies data you changed back so vidcard can use it, after Unlock you CAN'T use pointer returned with Lock. You need allways call Lock and get new pointer when you wan't to change data. D3DXMatrixRotationY, straight from the sdk: "Builds a matrix that rotates around the y-axis." but you can't use it in your code if you haven't translated d3dx9 header files in the sdk because these are not included in my zip. If you translate those please post them here so anyone can use them. SetTransform sets new transform matrix(read about matrices in sdk and/or use google to find info on them), first parameter is what matrix you want to change(world, projection, view or texture), second is the new matrix. I'm little bit drunk so sorry if there's typos/mistakes in my answer and i'm not very good at dx so that's another reason why there might be some mistakes. Edit: If you can't find the bug your self, please post your source so i can take a look at it. |
|||
21 Nov 2003, 00:18 |
|
Madis731 22 Nov 2003, 13:50
Nice to observe again the intelligence of Finnish people:) In my opinion you can code ANYTHING. And now - DirectX9 in assembler, good work
I could write in Finnish too, but other people won't understand, so.... I have the SDK, but I sort-of copy-pasted it into the assembler, after little modifications I got it compiled, but no reasonable result. The problem is that I can do BASIC and I can do C++, but when it comes to assembler, then I'm totally new to this. As soon as I started to change the sample provided, I got stuck, so no luck for me right now I will try the latter example and do my magic. See if I can get it to work, but I don't think that I dare to write my own routines. I would have to do ("katseeksitusmeetod" in Estonian), like just writing numbers and seeing what happens. This would ofcourse crash my computer few times and finally start working with bugs Wish me luck, now I will start coding... |
|||
22 Nov 2003, 13:50 |
|
aaro 22 Nov 2003, 16:22
Quote:
Good luck and thanks for your kind words. If you get stuck just post your source here or pm me and i'll try to help. |
|||
22 Nov 2003, 16:22 |
|
mike.dld 27 Aug 2004, 22:18
It's an old topic but...
aaro, could you please post any newer version of that example (with includes) for the latest FASM versions. I tried to modify the existing one but failed (Windows gaves me an error then trying to start app ) |
|||
27 Aug 2004, 22:18 |
|
proveren 28 Aug 2004, 07:16
DirectX9 is hard to compile even in C++ using DevCPP. There are things that the ms cpp compiler hides, the includes are also complex and there are some utility functions, defines, macros that are a pain in the translate in fasm.
So - go with OpenGL, no abstract objects, pointers, only simple functions and constants quite easy to fasm*. _____________________________________________ *fasm - (v.) 1. to translate to and assemble using FASM. 2. (slang) to make professinally clean and fast code. |
|||
28 Aug 2004, 07:16 |
|
vid 28 Aug 2004, 09:50
i think those header are overcomplicated like everything from M$, but it is possible to make them simple, you don't need all those stupid defines and macros, just something like privaloc's COMCALL macro and equates.
|
|||
28 Aug 2004, 09:50 |
|
proveren 28 Aug 2004, 10:01
Yes, the COMCALL and INTERFACE are very good and by the way I would like to say to all directx asm coders to either use the ddraw.inc that comes with fasmw package or when they are making custom directX includes to stick to that standard. I have seen too many DXCALLS, DDRAWINOVOKES, DDSURFACE4INVOKES, and whatnot. There really should be a standart in order to make DirectX accessible to the most asm coders without difficulty.
|
|||
28 Aug 2004, 10:01 |
|
slav 28 Aug 2004, 12:50
If you understand how COM works, it's quite easy to translate DX9 headers to fasm without those confusing macros. I've do it a few months ago, it's not as perfect as it could be (i did it for my own use) but i will post them with a working example so you can see it's almost as easy as OpenGL.
|
|||
28 Aug 2004, 12:50 |
|
slav 29 Aug 2004, 15:20
Just for my eyes... i will have to spend a few hours more on them to make them more handy. I "only" took me one morning to translate the D3D9 C includes...
|
|||||||||||
29 Aug 2004, 15:20 |
|
mike.dld 21 Sep 2004, 10:01
Another one request. Could anyone please write a simple (?) program using DD & D3D demonstrating rotating cube made up from 6 separate planes of different colors and some semitransparent text written. This would be a good example for me.
|
|||
21 Sep 2004, 10:01 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.