• Advertisement
Sign in to follow this  

DX8 - Reset method in Visualbasic(I get automation error)

This topic is 3028 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

------------------------ Public Sub SetDisplay(ByVal WindowsMode As Boolean, ByVal BufferWidth As Long, ByVal BufferHeight As Long) If m_State = 0 Then Exit Sub 'the var m_State lets us know if device is loaded or not With D3Dpp 'This is a global var .BackBufferWidth = BufferWidth .BackBufferHeight = BufferHeight .EnableAutoDepthStencil = 1 .Windowed=WindowsMode .AutoDepthStencilFormat = D3DFMT_D16 End With D3DDevice.Reset D3Dpp End Sub ------------------------ ... I want to change the device's displaymode. I read some articles and they told me I can change it with 'Reset' method. When I call this procedure, I got automation error. When I call it before the textures are loaded, I don't get error that time but in the render routine, I got 'exception error'. How can I change the device's displaymode?

Share this post


Link to post
Share on other sites
Advertisement
What pool do you load your textures into?

If they are in the default pool the program will crash. To solve this you have to release the textures before reseting and load them again afterwards or, you could load them into the managed or systemmem pool.

Some objects such as d3dxfont need to "looked after" on a reset. They need their OnDeviceLost function called before the reset and OnDeviceLost function after a reset.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement