Post

 Resources 

Console

Home | Profile | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 VBGamer
 VBGamer
 Restoration in DX8 Possible Bug Solution!

Note: You must be registered in order to post a reply.

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List Spell Checker
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

   Insert an File
Check here to include your profile signature.
Check here to subscribe to this topic.
    

T O P I C    R E V I E W
Iodiplin 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!
7   L A T E S T    R E P L I E S    (Newest First)
Iodiplin 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.
masterbooda 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...
Iodiplin Posted - Oct 12 2004 : 10:58:02 PM
It's final. I've tested it and everything.

The solution to using surfaces AND having restoration is very simple. Before resetting the device, set the pointer to nothing. For example:

  
Set ptrBackBuffer = Nothing  
  


After resetting the device, merely aquire it again.

  
Set ptrBackBuffer = Device.GetRenderTarget  
  


I tested it and it works. I did not have to reload or do anything special to my loaded surface.

I believe the same goes for render target pointers and surfaces used for additional swap chains.
Iodiplin 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.
Almar 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.
Eric Coleman Posted - Oct 09 2004 : 08:14:14 AM
Thanks for that information, it's good to know.
Iodiplin 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.

VBGamer © Go To Top Of Page
This page was generated in 0.09 seconds. Snitz Forums 2000

Copyright © 2002 - 2004 Eric Coleman, Peter Kuchnio , et. al.