I have been able to make it work with fullscreen, but for some reason i just can't get it to work in Windowed mode.
As i don't know much about C++ overall i am totally confused.
The only thing i have done is pretty much changed everything to "Ex", and made the:
Code: Select all
D3DDISPLAYMODEEX dm;
dm.Format = D3DFMT_X8R8G8B8;
dm.Height = present.BackBufferHeight;
dm.Size = sizeof(dm);
dm.RefreshRate = 60;
dm.ScanLineOrdering = D3DSCANLINEORDERING_PROGRESSIVE;
dm.Width = present.BackBufferWidth;
Otherwise i haven't really changed anything.
So, anyone have any ideas what might be wrong?
Code: Select all
present.BackBufferCount = 1; //Triple Buffering if 2
present.EnableAutoDepthStencil = TRUE;
if (Params.Vsync)
present.PresentationInterval = D3DPRESENT_INTERVAL_ONE;
else
present.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;
if (Params.Fullscreen)
{
present.BackBufferWidth = Params.WindowSize.Width;
present.BackBufferHeight = Params.WindowSize.Height;
// request 32bit mode if user specified 32 bit, added by Thomas Stuefe
if (Params.Bits == 32)
present.BackBufferFormat = D3DFMT_X8R8G8B8;
else
present.BackBufferFormat = D3DFMT_R5G6B5;
present.SwapEffect = D3DSWAPEFFECT_FLIP;
present.Windowed = FALSE;
present.FullScreen_RefreshRateInHz = D3DPRESENT_RATE_DEFAULT;
}
else
{
present.BackBufferFormat = d3ddm.Format;
present.SwapEffect = D3DSWAPEFFECT_DISCARD;
present.Windowed = TRUE;
}
D3DDISPLAYMODEEX dm;
dm.Format = D3DFMT_X8R8G8B8;
dm.Height = present.BackBufferHeight;
dm.Size = sizeof(dm);
dm.RefreshRate = 60;
dm.ScanLineOrdering = D3DSCANLINEORDERING_PROGRESSIVE;
dm.Width = present.BackBufferWidth;