Sign in to follow this  
e-milio

Device Reset fails with Points Sprites...

Recommended Posts

Hi... with VS C++ 6.0 and DX 9.0c i'm programming my own particle system using a dynamic VB with point sprites and a texture with alpha blending... al works correctly, and my particles are displayed as hoped, also i'm using to initialize and control the application messages and window, the mini framework from the SDK (the common files...), so the problems comes when the method Reset() is call over the device (for example you try to toggle to full screen or change the application window height or width). If you look at the code from SDK framework, the InvalidateDeviceObject() method is call, so i implemented on my particle system class this method, releasing all the device dependant objects [in this case, the VB and the texture], and also i've implemented the RestoreDeviceObject(), to re create the buffer for the points sprites and the textures after the reset, but unfortunately, this code is never execute because the reset fails, and the application aborts with an exit. I'm a totally beginner in D3D, so i'm sure that i'm missing something, by the way i've examined carefully the SDK point sprite example, and apart from that they don't use a texture, they execute the same SAFE_RELEASE() for the VB, at the InvalidateDeviceObject() method... Thanks one more time GameDev for this wonderful community!!! e-milio

Share this post


Link to post
Share on other sites
The problem is that you don't release something in your application. Enabling D3D debug build you'll see what objects aren't released (by ID). In control panels directx little program you can enable break in your build when certain ID is encountered. Just put that ID in the edit box, and your program will break in debug build when program encounters initalization of D3D object with that ID.
Then check if initalizatied object is released somewhere.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this