Archived

This topic is now archived and is closed to further replies.

Direct3D Problems......

This topic is 6024 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey everybody, Sorry for the newbie question, I know the EL337 have better things to do... I am just learning the basics of Direct3D, and I can successfully initialise Direct3D. However, as soon as I call either Clear() to clear the backbuffer, or BeginScene(), my app just quits! Just like that! If I comment out the rendering part of the game loop the app continues running. Has anyone had a similar problem? I would give you more info, but I don''t have anymore - it is truly a perplexing problem.... Anyway, thanks for you time guys, and kudos for helping out the little people. Lor.

Share this post


Link to post
Share on other sites
1. Try the samples from the SDK, if they behave in a similar way, check drivers (card+mobo, be warned leaked GF drivers are much less stable than officially released ones), check DX installation, check OS (service packs are good).
If they don''t behave in a similar way, theres a bug in your code (although the app shouldn''t just "quit" - sound like a release mode app), common places - D3D creation or doing other per-frame crimes.

2. When you installed the D3D SDK, you got an option to use the Debug runtime (slower, for development) or the Release runtime (quicker, but less tolerant) - since you''re developing code you should *definately* use the DEBUG version of the DirectX runtime.

3. Once you''ve installed the debug version of the DirectX runtime, go to the control panel and to the DirectX options, turn the debug output level for DirectDraw and Direct3D to maximum.

4. Make a debug build of your app (Win32 Debug in Build->Set Active Configuration for MSVC).

5. Start the debug build of your app **INSIDE THE DEBUGGER** (F5 in MSVC). If you use a compiler without a debugger, get yourself a program like DbgView (free from the sysinternals.com site).

6. Wait for the app to crash (access violation etc), then look in the Debug Output window of MSVC - in there you''ll see lots of "debug spew" telling you what DirectDraw and D3D were doing and also if you did anything wrong. (Thats one of the big differences between the release and debug runtimes, the latter will tell you what went wrong!)...

7. If the error has nothing to do with D3D (for example you''ve locked a texture and used the surface pointer without checking the lock return code), then you''ll have to single step it yourself in the debugger.
[Knowing how to use the debugger properly to trace errors and test code is something I''d consider an essential programming skill, as fundemental as knowing how to compile code]

--
Simon O''''Connor
Creative Asylum Ltd
www.creative-asylum.com

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Hi I just wanted to know how can I load 2 animation with d3d rm in delphi and then how to unload them???

THX

Share this post


Link to post
Share on other sites
Whoa, thanks SC1A, I didn''t even know I had posted this message. I clicked on "post", and I got an evil 404, so sorry for the delayed reply.

I solved the problem. It seems that I was calling my drawprimitive() thingy area too soon after initialising direct3d. I have no idea why this should cause the behaviour described, but put a few commands in between the two and my prog works like a dream.

Thanks for your time!

Lor.

Share this post


Link to post
Share on other sites