Iodiplin
Knave
USA
67 Posts |
Posted - Oct 08 2004 : 10:50:47 PM
|
I realize some have had troubles getting restoration to work in DX8. I was having the same problem. After much work in narrowing it down, the problem is quite simple:
Collecting a pointer for the back buffer for the use of rendering DX8 "Surfaces" will cause DX8 to crash upon render call after Reset.
Basically, I made my engine have the capability to render DX8 Surfaces (not restricted to size or shape, render easily in REF, but can only be rendered at 0,0 and without any modifications). This was my engine's bane however, because in doing so it was un able to reset (upon form resize, alt-tab, etc.). I merely remarked the line in my initialization code that collected the pointer to the back buffer (used for rendering such surfaces) and all worked beautifully.
This post is merely to let others know that their days of misery are over. However, this does mean that you can't render surfaces or at least will have to find a way to "uncapture" the pointer and "recapture" it after reset. Fortunately, surfaces are pretty much useless, so doing away with them won't kill anybody.
Hope this helps! |
Environment Makes All the Difference. |
|
Iodiplin
Knave
USA
67 Posts |
Posted - Oct 08 2004 : 11:46:16 PM
|
Also...If you're using the font rendering in the D3DX library, you must always call the font's OnLostDevice mothod before resetting and OnResetDevice after resetting, otherwise DX8 will crash (bringing your program with it) when you try to render with the font.
|
Environment Makes All the Difference. |
|
|
Eric Coleman
Gladiator
USA
811 Posts |
Posted - Oct 09 2004 : 08:14:14 AM
|
Thanks for that information, it's good to know. |
|
|
Almar
Moderator
Netherlands
192 Posts |
Posted - Oct 11 2004 : 4:51:05 PM
|
Yes, I've had this too a while back. Also stuff that is still locked can give problems. |
|
|
Iodiplin
Knave
USA
67 Posts |
Posted - Oct 12 2004 : 09:47:28 AM
|
I've found why that happens:
From the SDK: "Render target surfaces are placed in the D3DPOOL_DEFAULT memory class."
Remeber, you must always release any POOL_DEFAULT memory before resetting. So there is a way to destroy the pointer and recreate it after reset so you can still use surfaces. |
Environment Makes All the Difference. |
|
|
Iodiplin
Knave
USA
67 Posts |
|
masterbooda
Swordmaster
277 Posts |
Posted - Oct 13 2004 : 1:30:12 PM
|
Just wanted to put my two cents in...
I just wanted to let people know that if you are using the DX8 sprites, you have to release those also... just something i found out with the DaBooda engine...
Also surfaces are actually more important than people think because it is essential to use them to create graphics during runtime... a program with one 256x256 image to create 100's of different images is a whole lot smaller than trying to export one with 100's of individual images...
This is just my opinion on the last matter.... DaBooda out...
|
DaBooda Team is back: http://dabooda.789mb.com/ |
|
|
Iodiplin
Knave
USA
67 Posts |
Posted - Oct 13 2004 : 9:02:01 PM
|
Thanks...
DX8 Sprites eh? I've never used them. Are they useful/easy to use?
Ah, I didn't realize you could do that with surfaces, though it makes sense now that you mention it. |
Environment Makes All the Difference. |
|
|