Jump to content
  • Advertisement
Sign in to follow this  
the incredible smoker

Dynamic vertex buffer crashes change to fullscreen

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement

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.

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  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!