Archived

This topic is now archived and is closed to further replies.

If I am running fullscreen, is it ever a bad idea to...

This topic is 5133 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

... make the window be 0 pixels across, and 0 pixels down? It works for me (with XP), but I don''t know if it wouldn''t work with a different Windows version, or maybe it wouldn''t work for some other reason. Is there any reason not to do this?

Share this post


Link to post
Share on other sites
Do you mean to set the video mode to 0x0 (which I don''t think cards support) Or have the application window be 0x0... If its the application window, I don''t think anything bad would happen in fullscreen, however I''ve never tried it, so....

Share this post


Link to post
Share on other sites
not sure what you mean, but basically is your problem that when you make a ful screen the mouse still flickers on the sides and if u click it alt tabs?

basically that does is get rid of the borders or something

Share this post


Link to post
Share on other sites
No, what I am saying is the window will show right before the display mode switches to full screen.

Anyways, I found this in MSDN:

If you attempt to create a device on a 0x0 sized window, IDirect3D9::CreateDevice will fail.

However, it works fine for me. Could someone else try it?

Share this post


Link to post
Share on other sites
If you make a window with no title bar or borders.. (preferably with a black or white background) that is exactly the size of the screen. It will change the screen to that color, which will make the resolution switch less noticable.

Share this post


Link to post
Share on other sites
It just looks bad if a window pops up before switching to fullscreen mode. I think I will just make it 1 by 1 pixel, because of what was said on MSDN...

If you attempt to create a device on a 0x0 sized window, IDirect3D9::CreateDevice will fail.

...even though making it 0 by 0 does work for m). Making a window the size of the screen before switching over would be a good idea, but I wouldn't know the resolution of the desktop. Thanks for you guys' help! I know what I will do now.

[edited by - PlayGGY on November 26, 2003 11:42:43 PM]

[edited by - PlayGGY on November 26, 2003 11:43:18 PM]

Share this post


Link to post
Share on other sites
I don''t remember the specifics, but I recall that with an older version of DX creating a small window would allow mouse clicks to reach the desktop and launch apps. That''d be bad. Newer versions may do some magic when full-screen kicks in to block it, I haven''t tried it.

To make your window as large as the display:
window_width=GetSystemMetrics(SM_CXSCREEN);
window_height=GetSystemMetrics(SM_CYSCREEN);

All this and more in my lovely tutorials. Click my sig to be taken to D3D Heaven! (well, *I* think it''s cool)


Stay Casual,

Ken
Drunken Hyena

Share this post


Link to post
Share on other sites
quote:
Original post by DrunkenHyena
I don''t remember the specifics, but I recall that with an older version of DX creating a small window would allow mouse clicks to reach the desktop and launch apps. That''d be bad. Newer versions may do some magic when full-screen kicks in to block it, I haven''t tried it.

To make your window as large as the display:
window_width=GetSystemMetrics(SM_CXSCREEN);
window_height=GetSystemMetrics(SM_CYSCREEN);

All this and more in my lovely tutorials. Click my sig to be taken to D3D Heaven! (well, *I* think it''s cool)




Thanks for the info about the screen resolution. Is the problem you specified what happens when the size is 0 by 0? I haven''t tried clicking around, maybe that is what happens. So far though, no matter what size I set the window, everything works fine.

Share this post


Link to post
Share on other sites
I'm pretty sure that it meant if you tried to call d3d9 in windowed mode on a 0x0 window it would fail, because the size of the screen of fullscreen d3d is not determined by the window. If you tried to make fullscreen at 0x0 it would fail, but I don't think the window size matters in Fullscreen mode. Also, debug mode tends to be more forgiving than release mode, so it may be possible that something in d3d is working with DEBUG defined (or NDEBUG not defined) when it wouldn't otherwise.

Does a 0x0 window actually not appear? I've never tried it before, but when I work with dialog box resources it wouldn't let me go below a certain size...

[edited by - Erzengeldeslichtes on November 27, 2003 2:09:54 AM]

Share this post


Link to post
Share on other sites
I have a popup window, so nothing appears if the size is 0 by 0. Is it a good idea to not show the window? Is that how it is generally done? I thought about doing like that earlier, but I don''t know if its a good idea to have a window that exists but is just invisible. Of course, that is what I am doing if I make it 0 by 0...

Share this post


Link to post
Share on other sites
"is that how it's generally done?"

No, it's not. If you have played any 3d games recently you will ALWAYS see a window pop up before Direct 3d engages. This is because every professional game has support for windowed mode coded in, even if it's not covered by tech support or whatever. And overall, I HIGHLY recommend programming support for windowed mode because bug squashing in fullscreen mode is 100x more difficult than being able to use your compiler's debuging abilities.

[edited by - Erzengeldeslichtes on November 27, 2003 4:26:31 PM]

Share this post


Link to post
Share on other sites
quote:
Original post by Erzengeldeslichtes
"is that how it''s generally done?"

No, it''s not. If you have played any 3d games recently you will ALWAYS see a window pop up before Direct 3d engages. This is because every professional game has support for windowed mode coded in, even if it''s not covered by tech support or whatever. And overall, I HIGHLY recommend programming support for windowed mode because bug squashing in fullscreen mode is 100x more difficult than being able to use your compiler''s debuging abilities.

[edited by - Erzengeldeslichtes on November 27, 2003 4:26:31 PM]



Well, I just Alt+Tab, read the Debug messages, and Alt+Tab back.

Share this post


Link to post
Share on other sites
quote:
Original post by PlayGGY
Well, I just Alt+Tab, read the Debug messages, and Alt+Tab back.


When you Alt+Tab out you lose your device, so if you step through code in the debugger many calls will fail that normally wouldn''t. Being able to see debug messages while things are running can also be a huge help.

Honestly, making it so you can start in windowed or fullscreen is VERY easy. If you check out my tutorials they all pop up a message box to prompt for fullscreen or windowed and all the code is there (there isn''t a lot involved) to handle both modes. The code is free to use and doesn''t use any frameworks so you can just drop it in to your code with minimal effort.

Stay Casual,

Ken
Drunken Hyena

Share this post


Link to post
Share on other sites
I correctly handle lost devices though.

But I will add windowed functionality to my engine, after I finish the rest of it. Right now it is set up for fullscreen mode.

The hardest part will be dealing with the damn WndProc...

Share this post


Link to post
Share on other sites
I don''t see what the problem is for making windowed or fullscreen mode. It''s simple!

//D3D9 is what I''m showing here
void InitD3D(bool WindowedMode)
{
D3DPRESENT_PARAMETERS d3dParams;
d3dParams.Windowed = WindowedMode;
//rest of initialization code
}


That''s the only place I ever have to specify wether it''s windowed or not. Of course there are other places where I check, but that''s because of features I can only use in fullscreen mode (multiple monitors) or problems that only occur in fullscreen mode (losing devices).

The only thing that I''m not sure if you have to do differently is that you have to specify the window on your CreateDevice call. I don''t know if it''s required in Fullscreen mode, but it works fine.

Share this post


Link to post
Share on other sites
quote:
Original post by PlayGGY
I correctly handle lost devices though.



Sure, but you can only recover the device when you alt-tab back in to the app, and likely only at the end of your render loop. This makes it impossible to step through code in the middle of your render loop.

quote:

The hardest part will be dealing with the damn WndProc...

What''s the difficulty with WndProc?


Stay Casual,

Ken
Drunken Hyena

Share this post


Link to post
Share on other sites
quote:
Original post by Erzengeldeslichtes
That''s the only place I ever have to specify wether it''s windowed or not. Of course there are other places where I check, but that''s because of features I can only use in fullscreen mode (multiple monitors) or problems that only occur in fullscreen mode (losing devices).

The only thing that I''m not sure if you have to do differently is that you have to specify the window on your CreateDevice call. I don''t know if it''s required in Fullscreen mode, but it works fine.


Additionally you should check back buffer formats differently and probably create the window differently as well. But it is really easy to do.

And yes, even in fullscreen you still need the window.

Stay Casual,

Ken
Drunken Hyena

Share this post


Link to post
Share on other sites