flat assembler
Message board for the users of flat assembler.

Index > Windows > New Direct3D examples are released.

Author
Thread Post new topic Reply to topic
madmatt



Joined: 07 Oct 2003
Posts: 1045
Location: Michigan, USA
madmatt
Hello everyone Smile ,
This is a new release of 'Focus on 2d in direct3d' book examples. Chapter 4 is the newest addition. Also added some old examples from the 'Windows game programing for dummies examples', look in the 'DirectX Examples" folder. Also converted some windows examples included in the masm package. You can find them in the 'Windows Examples' folder.
You can download the newest release here:

FILENAME: 'FasmW - Direct 3D R2.rar'
FTP> ftp://68.225.35.57/
HTTP> http://www.asmdemon.com/
Post 04 Mar 2005, 00:36
View user's profile Send private message Reply with quote
djca



Joined: 14 Jul 2004
Posts: 21
djca
I tried your examples and I think they are cool. Unfortunately the Conway's Game of Life game is crashing on my computer. I played with it a little and found that the error is in this line:
Code:
D3DCALL d3dev, Clear, 1, ecx, D3DCLEAR_TARGET, [RedrawFrame.col],\
[RedrawFrame.temp], 0
    

When it is dissassmbled it is something like this:
Code:
push 0
push [ebp-04]
push [ebc-1C]
push 1
push ecx
push 1
mov eax, dword ptr [004012D0]
push eax
mov eax, dword ptr [eax] !!!Here the program crash!!!
call dword ptr [eax+00000090] !Here is the call to d3dev!
    

I hope this is useful info.
Post 04 Mar 2005, 10:49
View user's profile Send private message Reply with quote
madmatt



Joined: 07 Oct 2003
Posts: 1045
Location: Michigan, USA
madmatt
Hi djca,
Thanks!, was there an "logfile.txt" produced? Could you post this file so I could see the information that is in it? I forgot to mention that you should have directx 8.0 or greater to run these examples. What DirectX version is on your computer?
Matt
Post 04 Mar 2005, 18:18
View user's profile Send private message Reply with quote
djca



Joined: 14 Jul 2004
Posts: 21
djca
Ok. Here is the log file:

Direct3d Object Created successfully!
No HAL device, Creating software device (REF)
Couldn't create REF device, exiting program

And I am using DirectX9.0a.
Post 04 Mar 2005, 20:31
View user's profile Send private message Reply with quote
madmatt



Joined: 07 Oct 2003
Posts: 1045
Location: Michigan, USA
madmatt
The problem isn't really in the Clear function, It is because of improper exiting when the program fails to create either a hardware device or a software reference device. I have fixed that and will post the corrections shortly. What I haven't figured out yet, is why both the hardware and software reference devices are failing on your system. I'll look over the code again and see what I find, so far I haven't found anything that jumps out at me, except the problems above. I have a look later on, maybe by tommorrow you or I will have an answer.
Matt
Post 04 Mar 2005, 22:04
View user's profile Send private message Reply with quote
madmatt



Joined: 07 Oct 2003
Posts: 1045
Location: Michigan, USA
madmatt
Hello djca,
Here is the updated version of Chapter 2 Example 4 "Conway's game of life", the only thing I can think of that would cause both device creations to fail is the window isn't being created properly, recompile this program and post the logfile again.
Matt
Post 04 Mar 2005, 22:51
View user's profile Send private message Reply with quote
djca



Joined: 14 Jul 2004
Posts: 21
djca
Now the game doesn't crash but exit. Here is the log file:

Direct3d Object Created successfully!
No HAL device, Creating software device (REF)
Couldn't create REF device, exiting program
Direct3d object Released
<<** We are done, Exiting program. **>>

Well for example the 8 example in chapter 4 is working ok. Here is the log file:

Direct3d Object Created successfully!
Screen mode found
HAL Device Created Successfully
Direct3d device Released
Direct3d object Released
<<** We are done, Exiting program. **>>

As you can see here the HAL device is created succesfuly. I don't know maybe there is some kind of difference in the two examples.
Post 05 Mar 2005, 09:19
View user's profile Send private message Reply with quote
madmatt



Joined: 07 Oct 2003
Posts: 1045
Location: Michigan, USA
madmatt
Looks like the Window Creation is ok. Do you have problems with the other examples, or just this one. I'll take a closer look at the code from beginning to end and see what I find.
Matt
Post 05 Mar 2005, 14:39
View user's profile Send private message Reply with quote
madmatt



Joined: 07 Oct 2003
Posts: 1045
Location: Michigan, USA
madmatt
Made a print out of the original c++ code, and everthing is typed in correctly, I did change some of the window creation code a little to allow for an addtion of an icon, here is the original code parameters in asm:

Code:
invoke  CreateWindowEx, NULL, _class, _title, WS_OVERLAPPEDWINDOW + WS_VISIBLE,\
             0 , 0 , 640 , 480, NULL, eax, [hinst], NULL    
[/code]

cut and paste this over the old invoke CreateWindowEx...
Post 05 Mar 2005, 17:08
View user's profile Send private message Reply with quote
djca



Joined: 14 Jul 2004
Posts: 21
djca
Actually I found that only the examples which use fullscreen run (only fullscreen examples create HAL successfuly). I tried to start the Conway's Game of Life.exe in fullscreen and it starts although the screen image is not changing, but it is running. The examples which use window mode are not running.
Post 05 Mar 2005, 18:50
View user's profile Send private message Reply with quote
madmatt



Joined: 07 Oct 2003
Posts: 1045
Location: Michigan, USA
madmatt
Well, I've run out of ideas. Even with the executable for this particular example that came on the CD_ROM would not create the menu's properly, only after converting to assembly and running/compiling did the menus work properly. Other than that they all ran fine on my system. I can do one other thing, post the original code and executable and you tell me what happens, if the original works on your system, I'll rewrite the code to EXACTLY match the C++ code.
Matt
Post 05 Mar 2005, 21:25
View user's profile Send private message Reply with quote
djca



Joined: 14 Jul 2004
Posts: 21
djca
I tried the original and it crashes too. So I gues maybe my video card is having some king of problem with D3D in a window. I'll try it on another computer to see if it is workiing there.
Post 07 Mar 2005, 09:26
View user's profile Send private message Reply with quote
madmatt



Joined: 07 Oct 2003
Posts: 1045
Location: Michigan, USA
madmatt
Might want to try getting the latest driver update for your video card, and possibly re-installing directx 9.0 .
Post 07 Mar 2005, 17:19
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
in DirectX programming anything can cause you crash while initialization. In remember that my DirectDraw app crashed when setting cooperative mode because i had bad handle to background in window class of window in that i was running my app.
Smile
Post 08 Mar 2005, 12:32
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
madmatt



Joined: 07 Oct 2003
Posts: 1045
Location: Michigan, USA
madmatt
Too many things Evil or Very Mad ! Like using this piece of crap called the com interface Mad . And having to deal with lost surfaces Crying or Very sad . And the one above, the windowed surface, should be easier to setup than it is now Confused . But I'm kind of new to this DirectX way of doing things, Maybe with more time I'll know how to do things as fast as how I did things back in my DOS VESA graphics days, and be a bit happier about DirectX programing as well Smile .
Matt
Post 08 Mar 2005, 17:46
View user's profile Send private message Reply with quote
madmatt



Joined: 07 Oct 2003
Posts: 1045
Location: Michigan, USA
madmatt
Hello djca,
Have you got the windowed examples working yet?
Post 11 Mar 2005, 14:50
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.