Skip to main content
GameDev.net gamedev.net
🔒 Locked

Strange D3D error

Started by d000hg Dec 20, 2002 at 4:59 AM 2 replies 200+ views
Original Post
d000hg
d000hg
My 3d engine runs fine, in fact perfectly in windowed mode. In full-screen though it still runs but when I quit I always get the error message about ''blah blah has caused an error and will be shut down''. I managed to debug and found the problem was releasing a texture. Why would this be a problem - I''m sure the texture exists as I use it! And why only in full-screen? I can''t remember if I release the textures before/after the D3D device - is that a factor?
Read about my game, project #1 NEW (18th December)2 new screenshots, one from the engine and one from the level editor
John 3:16
Jim Adams
Jim Adams
The texture pointer may be invalid (NULL):

IDirect3DTexture8 *pTexture = NULL;
pTexture->Release();

The above will cause a GPF.


Jim Adams
home.att.net/~rpgbook
Author, Programming Role-Playing Games with DirectX
and Focus On: Advanced Animation with DirectX

d000hg
d000hg
No I check that:
if(Textures!=NULL)
Textures[i]->Release();
S1CA
S1CA
quote:
I can''t remember if I release the textures before/after the D3D device - is that a factor?


Possibly. Release them BEFORE you release the device.

Another possibility (particularly if the device is released before the textures) is that the surfaces have become lost during some mode change/release. Does the D3D debug runtime with all the levels ramped to maximum tell you anything in the output?



--
Simon O''Connor
Creative Asylum Ltd
www.creative-asylum.com
Simon O'Connor | Technical Director (Newcastle) Lockwood Publishing | LinkedIn | Personal site

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.