   Steirstepping edges
  Anyone else is getting stairstepping edges on their primitives when using implicitly created chain of buffers during window resizes in windowed mode? Opengl creates nice smooth edges. No filtering used in d3d9 or gl, just a simple gouraud shaded triangle. Proj.mat. is being reset with correct aspect ratio and on gl the viewport being set as well. In d3d9 the viewport is implicitly set I think. Looks like in d3d the back buffer is stretched blitted to front buffer. D3DDISPLAYMODE dm;g_pD3D->GetAdapterDisplayMode(D3DADAPTER_DEFAULT, &dm;ZeroMemory(&g_pp, sizeof(g_pp));g_pp.hDeviceWindow = hWnd;g_pp.Windowed   = TRUE;g_pp.SwapEffect = D3DSWAPEFFECT_DISCARD;g_pp.BackBufferFormat = dm.Format;g_pp.BackBufferCount = 1;g_pp.EnableAutoDepthStencil = TRUE;g_pp.AutoDepthStencilFormat = D3DFMT_D24S8;  
  I''ve seen the same thing.  I just assumed it was because when I created the device, I set the D3DPRESENT_PARAMETERS BackBufferWidth and BackBufferHeight to 0.  This causes the back buffer to be the same size as my window''s client area.  When the window is then resized, a stretch blit operation occurs.I haven''t tried creating a back buffer the size of the desktop, then adjusting viewport parameters to the window''s client area.  I''m guessing that would eliminate the "stairstep" effect you''re seeing.;  Don, I''m getting the same stair effect when shrinking the window as well, meaning larger back buffer is shrink blitted to smaller front buffer. Same thing as you propose I think with the desktop solution(correct me if I''m wrong). Interestingly, when the window first shows on the desktop the edges are perfectly straight no matter what the size of the window. I posted on ms dx newsgroup so I''ll see what ms has to say about this. It''s good though that you replied since it confirms that I''m not doing anything strange and the problem might as well be in d3d9. Thanks for insight;  I''ve experimented more and it seem d3d doesn''t handle this correctly. I have two choices either preserve primitive size during window resizing but live with stairstepping edges or have smooth edges but primitive resizes as well with window resize. I can not have both as I can in opengl. If you want smooth edges in d3d you need to use height/width for aspect ratio. If you want constant primitive size you need to use width/height for aspect ratio. Gl uses width/height and it gives you smooth edges. The stair stepping is noticeable when enlarging window size as the stairs are low in frequency and this what makes it so visible. There are two or three jumps along the length of the edge. In gl it''s perfectly smooth. No filters of any kind were used either thru the app or driver screen. I have aa/af off in drivers, fastest image iq and slider is set to application preference. I have gf2. I tried setting a viewport each time window is resized but d3d doesn''t like that. Seems this is set internally when window is resized. The only thing I can play with is the projection matrix and what you get depends solely on aspect ratio.  ;  >>I tried setting a viewport each time window is resized but d3d doesn''t like that.<<It certainly didn''t like it when I tried to set the viewport larger than the size of the render target, but that''s why I made the comment about creating the device with a back buffer the size of the desktop.  You certainly should be able to set a viewport that is equal to, or smaller than the size of the back buffer.  I would think that doing this along with changing your FOV (via the projection matrix) as the window is resized should give you what you want.;  on resize: d3ddevice->Reset()  ;  Problem solved However it was sheer luck. The problem occurs when you feed to Reset() the original presentation param struct that I had set as a global var. Instead what I did to correct this was in wm_size handler I created a new present param struct, filled it with same values as those in global pp struct then I called Reset() and it worked. Very strange don''t you think? I would understand it if I had to fill new width/height params based upon the new window size but they''re zero here. Maybe I''m dummy but this had me stumped for some time I''m glad it''s fixed. Thanks for all your help.Here''s my pp in wm_size handler:D3DPRESENT_PARAMETERS pp;ZeroMemory(&pp, sizeof(pp));pp.Windowed   = TRUE;pp.SwapEffect = D3DSWAPEFFECT_DISCARD;pp.BackBufferFormat = D3DFMT_X8R8G8B8;pp.BackBufferCount = 1;pp.EnableAutoDepthStencil = TRUE;pp.AutoDepthStencilFormat = D3DFMT_D24S8; g_pd3dDevice->Reset(&pp;;  I found two other things. One, setting new projection matrix needs to happen after reset call. Two, present params structure fills in window width and height values at reset call. That''s why I can''t use a global present param struct and keep reusing it for windowed app. You can set width and height values to zero before calling reset().  