Click to See Complete Forum and Search --> : Direct3D 9 Window Resizing


Fromethius
August 4th, 2007, 03:25 AM
Hey everyone. I'm having this problem when I resize my Direct3D app in windowed mode.

If I contract my window (as in make the size less), it contracts perfectly.

However, if I expand it, as I'm expanding the window, it attempts to redraw the app, resulting in very ugly effects such as this:

http://i192.photobucket.com/albums/z20/Fromethius/wtfROFL.png

Of course, after I let go of my left mouse button, it goes back to normal. However, I would prefer those lines didn't appear as I was resizing the app

Thanks

bitshifter420
August 4th, 2007, 07:02 AM
What This Looks Like, Is That Your Not Handling WM_PAINT Messages.

Do Something Like This In The Main Switch Of The Window Procedure.

case WM_PAINT:
ValidateRect(NULL);
yourRenderScene(...);
yourSwapBuffers(...);
return 0;

case WM_ERASEBKGND:
return 1;


This Should Cure It For You.

I Dont Code DirectX, But OpenGL Instead, But This Is All Win32 Anyway.

It Is Also A Good Idea To Register Your Window With A NULL Background Brush.

Good Luck!

miteshpandey
August 4th, 2007, 08:22 AM
Try using the following class styles when you create your window class

WNDCLASSEX winclass = {
winclass.cbSize = sizeof(WNDCLASSEX),
CS_DBLCLKS | CS_OWNDC | CS_HREDRAW | CS_VREDRAW,
.......................
.......................
.......................
}


CS_HREDRAW and CS_VREDRAW may apply to u specifically if you have not used them yet.

Fromethius
August 4th, 2007, 12:49 PM
I tried all the above suggestions but to no avail. Any other suggestions?

bitshifter420
August 4th, 2007, 01:21 PM
I Guess I Should Have Said ValidateRect(yourWindowHandle, NULL);

Or Did You Catch That Like I Had Assumed You Would?

Mike Harnad
August 6th, 2007, 09:55 AM
Without seeing code, it's hard to tell what your problem is. However, I would suggest making sure you have the correct flags set for your directx device. In Particular, "SwapEffect".