I'm attempting to get my program to run full screen instead of windowed, but when I set the PresentParameters windowed attribute to FALSE, CreateDevice() fails. I turned on some debugging to find that it seems to be my PresentParameters being wrongly initialized, though it works fine for windowed mode.
I've looked at many examples and no one seems to be having the same errors. What's more, there seems to be nothing wrong with my parameters, so I've given up and asked here.
Here's my initialization:
Present_Parameters.SwapEffect = D3DSWAPEFFECT_DISCARD; // Dealing with animation (see doc). Present_Parameters.BackBufferCount = 1; // Number of back buffers. Present_Parameters.EnableAutoDepthStencil = TRUE; // Check documentation. Present_Parameters.AutoDepthStencilFormat = D3DFMT_D16; // Check documentation. Present_Parameters.BackBufferFormat = D3DFMT_X8R8G8B8; Present_Parameters.Flags = 0; Present_Parameters.hDeviceWindow = hwnd; Present_Parameters.MultiSampleQuality = 0; Present_Parameters.MultiSampleType = D3DMULTISAMPLE_NONE; Present_Parameters.PresentationInterval = 0;
I have also set the relevant fullscreen parameters, like so:
Present_Parameters.Windowed = FALSE; // Window mode (fullscreen). Present_Parameters.BackBufferWidth = 1920; Present_Parameters.BackBufferHeight = 1080; Present_Parameters.FullScreen_RefreshRateInHz = 60;
Any help would be appreciated, thanks.