Jump to content
  • Advertisement
Sign in to follow this  
mrmrcoleman

Fullscreen/Windowed...

This topic is 4828 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I had thought that my 2d DirectX app was running in fullscreen mode but apparently not. The app runs at 1024x768, and my desktop size is 1024x768. Up until now the app had appeared full screen, however I recently tested it with a higher resolution for my desktop and the app now plays as a smaller pane in the top left corner. Here is my windows initialisation code.
HRESULT MakeWindow (HINSTANCE hInstance)
{
   	WNDCLASSEX wc = {sizeof(WNDCLASSEX),
						CS_CLASSDC,
						MsgProc,
						0L,
						0L,
						GetModuleHandle(NULL),
						NULL,
						NULL,
						NULL,
						NULL,
						"Star Chart",
						NULL};

	RegisterClassEx(&wc);

    g_hWnd = CreateWindow( TEXT("Stargazer"), TEXT("Stargazer"),
                           WS_POPUP | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, 0, 0, 1024, 768,
                           GetDesktopWindow(), NULL, wc.hInstance, NULL );

    //Make sure window was created properly
    if (g_hWnd == NULL)
	{
		DXTRACE_MSG(TEXT("Could not create the window"));
        return S_FALSE;
	}

	ShowWindow(g_hWnd, SW_SHOWNORMAL);
	UpdateWindow(g_hWnd);

    //Success
    return true;
}

I had assumed that the display settings would be changed upon start up to 1024x768, and then reverted again when the application finished. Doe anybody know what I am doing wrong here? Mark

Share this post


Link to post
Share on other sites
Advertisement
This is not the interesting part of code -- the part where you set up and configure the device is. For a fullscreen application the window is merely a placeholder because the fullscreen rendering will take over. You must specify in the PRESENT_PARAMTERS structure that you want to render full screen.

Greetz,

Illco

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!