Dynamic vertex buffer crashes change to fullscreen

Started by
6 comments, last by the incredible smoker 5 years, 10 months ago

Hi, i am making a game with DirectX9.

I like to use a vertexbuffer with the D3DUSAGE_DYNAMIC flag, ( reading the documents say it will be faster with this flag for dynamic usage )

It all works fine until i go fullscreen when the dynamic buffer is in use, then my game exits/crashes.

 

I have the feeling it has to do with restoring the renderstate, maybe some code is missing there ?

I read something online that when the D3DPOOL_DEFAULT is used, it needs to restore something ?

the code looks like this :

CreateVertexBuffer( size , D3DUSAGE_DYNAMIC | D3DUSAGE_WRITEONLY ,  D3DPOOL_DEFAULT , vb , NULL );

 

How do i fix this ?

thanks

S T O P C R I M E !

Visual Pro 2005 C++ DX9 Cubase VST 3.70 Working on : LevelContainer class & LevelEditor

Advertisement

I will leave it non dynamic then, it also works the same.

S T O P C R I M E !

Visual Pro 2005 C++ DX9 Cubase VST 3.70 Working on : LevelContainer class & LevelEditor

How do you handle device loss?

I dont have anything for that, i dont know how or what to do, i just have a vertex buffer being init 1 time.

S T O P C R I M E !

Visual Pro 2005 C++ DX9 Cubase VST 3.70 Working on : LevelContainer class & LevelEditor

For device loss it restores render state, i try change the color there, still a crash.

S T O P C R I M E !

Visual Pro 2005 C++ DX9 Cubase VST 3.70 Working on : LevelContainer class & LevelEditor

Are you actually trying to support Windows XP? If you only need to run on Windows Vista and up, you can create an "Ex" device instead. An Ex device won't go into "device lost" state unless the driver crashes, so you won't have to deal with that. There's some more info here and here.

Thanks for the info.

I am developing the game on a windows XP computer.

I also use on board videocard, very minimal setup.

There are many old computers out there, my game will run on it.

S T O P C R I M E !

Visual Pro 2005 C++ DX9 Cubase VST 3.70 Working on : LevelContainer class & LevelEditor

This topic is closed to new replies.

Advertisement