# Unity [C++, Win32] Nasty resizing/rendering issue

## Recommended Posts

Hello community!

I have some nasty resizing issue with my toolbar-windows of my engine's editor.
Each toolbar-window is a child of the main dialog, and they are aligned around the main viewport.
That gives me 4 windows which all render their own scene.
One for the top, one for the left, one for the bottom and one for the right.
The layout works well, and resizing them all does, too, but one thing isn't working as it should: Rendering after the resize.

Here is a picture of how it looks after I dragged the bottom-right corner of the window a bit:

Those white borders are pretty ugly and pretty annoying. How do I get rid of them?

Here is how it should look like (After some playing around with the debugger to force a redraw):

Just for sure, I do call the render-function in WM_PAINT, and also test-wise in WM_SIZE (Doesn't help, though).

Here is the first part of the DlgProc:
switch(msg)		{		case WM_SIZE:			// Resize our main windows controls			RECT r;			GetClientRect(hWnd, &r);			// Main Viewport			SetWindowPos(GetDlgItem(hWnd, IDC_Viewport), 						 HWND_TOP, 						 EE_WNDB_MainVP_LEFT, 						 EE_WNDB_MainVP_TOP, 						 (r.right - EE_WNDB_MainVP_RIGHT) - (EE_WNDB_MainVP_LEFT), 						 (r.bottom - EE_WNDB_MainVP_BOTTOM) - EE_WNDB_MainVP_TOP, 						 0);			// Right browser window			SetWindowPos(GetDlgItem(hWnd, IDC_wbrowser), 						 HWND_TOP, 						 r.right - EE_WNDB_MainVP_RIGHT, 						 0, 						 EE_WNDB_MainVP_RIGHT, 						 r.bottom, 						 0);			// left toolbar window			SetWindowPos(GetDlgItem(hWnd, IDC_SideBar1), 						 HWND_TOP, 						 0, 						 EE_WNDB_MainVP_TOP, 						 EE_WNDB_MainVP_LEFT, 						 r.bottom-EE_WNDB_MainVP_TOP-EE_WNDB_MainVP_BOTTOM, 						 0);			// upper toolbar window			SetWindowPos(GetDlgItem(hWnd, IDC_MainToolbar), 						 HWND_TOP, 						 0, 						 0, 						 r.right - EE_WNDB_MainVP_RIGHT, 						 EE_WNDB_MainVP_TOP, 						 0);			// sub toolbar window			SetWindowPos(GetDlgItem(hWnd, IDC_SubToolbar), 						 HWND_TOP, 						 0, 						 r.bottom - EE_WNDB_MainVP_BOTTOM, 						 r.right - EE_WNDB_MainVP_RIGHT, 						 EE_WNDB_MainVP_BOTTOM, 						 0);						//Set the viewport area to the toolbars and the browser			GetWindowRect(GetDlgItem(hWnd, IDC_Viewport), &r);			Engine->GetLeftToolbar()->SetMainViewportArea(&r);			Engine->GetMainToolbar()->SetMainViewportArea(&r);			Engine->GetBottomToolbar()->SetMainViewportArea(&r);			Engine->GetWBrowser()->SetMainViewportArea(&r);			//Resize swapchain			Engine->GetToSwapchainRenderer()->ResizeBuffers(0, 0);			break;		}		//Pass the messages to the registered SF_Dialog windows		Engine->GetMainEditorWindowSFContainer()->OnWindowMessage(hWnd,msg,wParam,lParam);

And this is the call inside the last line of the upper code:
case WM_PAINT:		GetD2DObjects()->bNeedsRedraw=true;		RenderScene(true);		break;	case WM_SIZE:		RECT s;		GetClientRect(WindowHW,&s);		GetD2DObjects()->WindowSize.left=s.left;		GetD2DObjects()->WindowSize.top=s.top;		GetD2DObjects()->WindowSize.right=s.right;		GetD2DObjects()->WindowSize.bottom=s.bottom;		GetD2DObjects()->RenderTarget->Resize(SizeU(s.right,s.bottom));		GetBaseObject()->SetSize(&D3DXVECTOR2(s.right,s.bottom));				RenderScene(true);		break;

##### Share on other sites
Solved it by making the controls owner drawn. (They are transparent then)

## Create an account

Register a new account

• ### Forum Statistics

• Total Topics
627738
• Total Posts
2978881
• ### Similar Content

• By KARTHI
• By KARTHI
Currently I using makehuman to make a 3d models but I am not satisfied with that model. If any use this please reply about the quality and details of models.
🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔
• By KARTHI
I planned to make a space game so I need a knowledge about 3d planet making so anyone help me to make it possible
🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔
• By KARTHI
I planned to make a game like star citizen. In this game player can travel through the space ,explore the planets, Hunt the different creatures, drive the space ship, explore different regions in universe, destroy the space stations and also player can go anywhere in the universe and meet aliens and so on
Did you like this idea?
Please give me reply so that I can easily understand what you want.
🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔

• Your home planet was attacked. Now you have to use your spaceship to battle the invaders. Powerful 3D arcade with outer space background. Very addictive. Good luck!