Full screen in Windows programming

Started by
2 comments, last by Timptation 15 years, 8 months ago
I'm making a DirectX game and have my presentation parameters set so that it is in fullscreen (d3dPP.Windowed = false;), so I think my problem is with my Windows code. I tried setting the CreateWindow function to place the window at 0,0 and screen width/height, but the window border's title bar keeps trying to pop back in for a flickering effect. Sooooo: 1) Can I disable the border or set fullscreen mode a better way? 2) Also, is there a way to grab screen width/height from Windows so I don't have to hardcode it?
Advertisement
I'm not a fullscreen expert so I can't really help with part 1, but I do know the answer to part 2. GetSystemMetrics with an arguement of either SM_CXSCREEN or SM_CYSCREEN will give you either the x or y dimensions, respectively.
[size=2][ I was ninja'd 71 times before I stopped counting a long time ago ] [ f.k.a. MikeTacular ] [ My Blog ] [ SWFer: Gaplessly looped MP3s in your Flash games ]
Quote:Original post by Timptation
I'm making a DirectX game and have my presentation parameters set so that it is in fullscreen (d3dPP.Windowed = false;), so I think my problem is with my Windows code. I tried setting the CreateWindow function to place the window at 0,0 and screen width/height, but the window border's title bar keeps trying to pop back in for a flickering effect. Sooooo:

1) Can I disable the border or set fullscreen mode a better way?

2) Also, is there a way to grab screen width/height from Windows so I don't have to hardcode it?
1. You should use WS_POPUP instead of WS_OVERLAPPEDWINDOW as your window style.

2. IDirect3D9::GetAdapterDisplayMode is the Direct3D way of doing it, as it'll give you the pixel format for the monitor too, and will work with multiple monitors (Where GetSystemMetrics will give you the resolution for all monitors, not just one, which is what D3D wants).
Awesome. Thanks guys!

This topic is closed to new replies.

Advertisement