[MDX] Device Resize

Started by
16 comments, last by alex_myrpg 17 years, 10 months ago
Thanks for your replies - it's the GUI system (includes many vertex buffers) that need to be recreated I believe, and fonts too possibly. The problem is if i let DX handle resizing itself it just stretches the display to fit the screen, and I don't want that. Any ideas please?
Advertisement
MDX only stretches the screen to fit the display if you've cancelled the resize handling by MDX via the following:


void device_DeviceResizing(object sender, CancelEventArgs e){   e.Cancel = true;}


setting e.Cancel to true stops MDX from handling it's own resizing. Instead simply reset your render states and data structs in the event without cancelling:

void device_DeviceResizing(object sender, CancelEventArgs e){   this.ResetRenderStates();}


if a vertex buffer is created with the managed flag then it will automatically be recreated. You don't have to handle those if you don't want, but you have to specify managed in the pool argument during construction of the buffer. ie:

Pool.Managed;

HTH,

Devin
-Devin



Hi, the problem is I'm using MDX 2 which doesn't have a DeviceResizing event (or allow it to be cancelled)... however my engine used to be in MDX 1.1 (which is what you're referring to) and when I didn't cancel the device resize I got the error. :S thanks for sticking with the problem anyway. this is all very confusing - maybe i could send the code to someone to look at if anyone's feeling very helpful ? it would be much appreciated...

EDIT: I just realised that after removing the GUI system now, it doesn't help. In fact, if I render nothing it still occurs; the only time it *doesn't occur* is when I don't load any resources at all.

[Edited by - alex_myrpg on May 31, 2006 6:54:01 AM]
Ok, well I've just figured out it's to do with Video (DirectShow .NET) and a thing called the VMR Allocator. I believe it's because surfaces in Pool.Default aren't getting reset or something, but I don't know enough to explain more sorry. Thanks for all the help anyway!
Yes perhaps if you posted some code. I'm not familiar with MDX2 as I won't be using it. Actually I think it's a dead end to even use it as Microsoft won't offically support it. They are migrating to XNA and MDX2, from what I've read, is just FYI or something. I'll stick with MDX1 till XNA is fully saturated.

And please, correct me if I'm wrong :)

-Devin
Well as far as I'm concerned, it's really not very different and easy to convert back. And maybe I could just send the Allocator and Video classes that I use to render video (using the DirectShow .NET library). You may not be familiar with the DirectShow parts but the surfaces are what's causing the problem and that's plain old Direct3D. If you're willing to help more, please PM me your email so I can send you the Allocator class - thanks very much.
I may have been wrong about MDX2. I read in another post that perhaps XNA will ship with MDX2. I beleive what I should have said is that MDX2 is not currently an active system, but will be. So the question is how much will it change when an official release is made?

I'll pm you in a sec.

-Devin
Hey, are you still around devronious? I've really narrowed down the source of the problem now but it's not quite yet fixed. Please PM me/reply if you are. Thanks

This topic is closed to new replies.

Advertisement