Post

 Resources 

Console

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

 All Forums
 VBGamer
 VBGamer
 Restoration in DX8
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

EACam
Warrior

154 Posts

Posted - May 01 2004 :  6:46:32 PM  Show Profile  Reply with Quote
OK ok ok ok ok o k ok

I've tried everything:

**I've looked at examples of working code and found barely any difference between theirs and mine.
**I've exausted the SDK
**I've spent hours of hopelessness trying random things that never did one diddle

Ok, when I check to see if the device is lost, I pause my main loop, when I get the D3DERR_DEVICENOTRESET error from the TestCooperativeLevel I try to reset the device. Well, it turns out that I can't reset the device for anything...ever. I've used for doing other things such as going from windowed to fullscreen on the same device (without completely reinitializing) and I got the same error.

Here's what happens. According to my Log file, the Reset operation returns the D3DERR_DEVICELOST error code. It then finishes the sub and returns that the device is not ready for rendering so my pause loop continues and check it again again until it's fixed. I know this because my log file says the sub finishes ok. But then I get a C++ error (you know, not a plain VB error) and, if I'm running in the IDE, EVERYTHING closes (that is, the IDE and the program). If I'm running a compiled version of the program, it simply gives me the error and closes.

I don't have a CLUE what's going on. I know my presentation parameters that I use for resetting the device are the same as when I initialized (I use the same variable for goodness sake, and I've checked it for changes).

THIS SHOULD BE WORKING!!!!

I've tried releasing memory (even tho everythings loaded in Pool_Managed anyway).

PLEASE HELP!!! I can't even begin to guess why this isn't working.



Thanks.

Eric Coleman
Gladiator

USA
811 Posts

Posted - May 01 2004 :  8:10:03 PM  Show Profile  Visit Eric Coleman's Homepage  Reply with Quote
Read Lucky's post, http://voodoovb.talosstudios.com/archives19.html

Does that help any?

Go to Top of Page

EACam
Warrior

154 Posts

Posted - May 01 2004 :  8:46:00 PM  Show Profile  Reply with Quote
Sorry, that sounds like a different degree of a problem.

Mine is causing DX8 to give me an error and everything closes (crashes).

(It's also using DD7...)
Go to Top of Page

Eric Coleman
Gladiator

USA
811 Posts

Posted - May 01 2004 :  9:17:27 PM  Show Profile  Visit Eric Coleman's Homepage  Reply with Quote
Ok, so its an "error." That really helps. I know eactly what the problem is.
Go to Top of Page

EACam
Warrior

154 Posts

Posted - May 02 2004 :  08:03:34 AM  Show Profile  Reply with Quote
I described that "error" in detail in my first post
Go to Top of Page

Lachlan87
Moderator

USA
160 Posts

Posted - May 02 2004 :  11:34:26 AM  Show Profile  Reply with Quote
I would recommend you try to re-create the error in a new project. All you should need to do is copy your intitialisation code, your code for handling device loss, and write a extremely simple game loop to use it all. You don't even have to display any graphics or anything. If you can't re-create the error by doing this, it would be a big step toward solving the problem. If the error still occurs, you will have a very small little bit of functioning source code you can e-mail me or anyone else interesting in helping you solve your problem. I can't tell you how many times I've managed to solve a bugger of a problem by reducing the amount of code I'm working with like that.

As it is right now, I have a hard time invisioning what your code looks like, or even what your errors look like.
Go to Top of Page

Spodi
Warrior

USA
142 Posts

Posted - May 02 2004 :  2:03:54 PM  Show Profile  Visit Spodi's Homepage  Send Spodi an AOL message  Click to see Spodi's MSN Messenger address  Send Spodi a Yahoo! Message  Reply with Quote
I got it on DXRE, I can send you the code to do it in a few hours.


vbGORE
Go to Top of Page

EACam
Warrior

154 Posts

Posted - May 02 2004 :  8:27:33 PM  Show Profile  Reply with Quote
Cool. Thanks!
Go to Top of Page

Spodi
Warrior

USA
142 Posts

Posted - May 05 2004 :  12:13:01 AM  Show Profile  Visit Spodi's Homepage  Send Spodi an AOL message  Click to see Spodi's MSN Messenger address  Send Spodi a Yahoo! Message  Reply with Quote
For future reference, here is what I sent EACam:

  
'Check to see if the d3d device is not ready
If D3DDevice.TestCooperativeLevel <> D3D_OK Then
  
    'Check to see if the device can be reset  
    If D3DDevice.TestCooperativeLevel = D3DERR_DEVICENOTRESET Then
  
        'Clear the font from memory  
        MainFont.OnLostDevice  
  
        'Reset the device  
        D3DDevice.Reset D3DWindow  
  
        'Restore the font  
        MainFont.OnResetDevice  
  
        'Reset the textures and device settings  
        Engine_Init_Gfx  
  
    Else
  
        'Exit the sub since the device is not ready to be used or reset  
        Exit Sub
  
    End If
  
End If
  
'Make sure the screen is not minimized
If frmMain.WindowState = vbMinimized Then Exit Sub
  


~D3DDevice is, well, the d3d device
~frmMain is whatever form you set the device to draw to
~MainFont is your D3DXFont(s) - make sure you list them all
~Engine_Init_Gfx is a sub that does the following:
1) Restore all device render states
2) Restore all textures

vbGORE
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
VBGamer © Go To Top Of Page
This page was generated in 0.16 seconds. Snitz Forums 2000

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