I am trying to make a game. I am using directx 9 to do so and I have some issues trying to go into full screen mode. I made a function that initalized all of the Present Parameters . Everything is fine except when I make windowed = false (ie i set fullscreen to true).
here is my present parameters variable: D3DPRESENT_PARAMETERS d3dpp;
Here is the code for the d3dpp variable. Most if not all of this code comes from a book called Programming 2d Games by charles kelley.
void Graphics::initD3Dpp()
{
try {
ZeroMemory(&d3dpp, sizeof(d3dpp));
d3dpp.BackBufferWidth = width;
d3dpp.BackBufferHeight = height;
if (fullscreen)
d3dpp.BackBufferFormat = D3DFMT_X8R8G8B8;
else
d3dpp.BackBufferFormat = D3DFMT_UNKNOWN;
d3dpp.BackBufferCount = 1;
d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
d3dpp.hDeviceWindow = mainhwnd;
d3dpp.Windowed = (!fullscreen); //THIS LINE RIGHT HERE IS THE ISSUE
d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;
}
catch (...)
{
throw(GameError(gameErrorNS::FATAL_ERROR,
"Error initializing D3D presentation parameters"));
}
}
I do not see why .windowed does not work for me. Please ask me if you need more context.
CreateDevice
call. WhatHRESULT
do you have fromCreateDevice
? And put all additional data to question itself. – Michael Nastenko