Jump to content
  • Advertisement
Sign in to follow this  
Narf the Mouse

SlimDX, Winforms and full-screen

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

What I can do fine: Use WinForms controls when running SlimDX in a window.

The problem: Switching to full-screen results in controls flickering between visible and invisible at a high rate of speed, or just going invisible, as they are over-written and possibly re-drawn.

The question: Is there a way to have Winforms controls display correctly in SlimDX/DirectX fullscreen (using "DirectX 9.0c")? And if so, how have other people solved it?

Thanks.

(Any incoherence can be blamed on lack of sleep. :) )

Share this post


Link to post
Share on other sites
Advertisement
Windows Forms is rendered with GDI. Using GDI and D3D over the same pixel airspace results in the problem you are observing as they both compete to render to those pixels.

The only way you can make this work is to trim up the screen real estate and allow only GDI, or only D3D, to render to the appropriate region. You cannot do this is exclusive full screen mode; you'll have to run in "full screen windowed" mode, which is just windowed mode where your main window is resized to be the dimensions of the screen (and immovable, et cetera).

Share this post


Link to post
Share on other sites

Windows Forms is rendered with GDI. Using GDI and D3D over the same pixel airspace results in the problem you are observing as they both compete to render to those pixels.

The only way you can make this work is to trim up the screen real estate and allow only GDI, or only D3D, to render to the appropriate region. You cannot do this is exclusive full screen mode; you'll have to run in "full screen windowed" mode, which is just windowed mode where your main window is resized to be the dimensions of the screen (and immovable, et cetera).

Not quite sure what you're referring to with "full screen windowed"; could you give an example, maybe some simple code?

Thanks.

Edit: To clarify: I think I do know, but "think I do know" is not the same as "know".

Edit2: Probably got it. It did seem to work ("display" is a Windows.Forms.Control, hence the conversion):


Form d = (Form)display;
d.AutoScaleMode = AutoScaleMode.Dpi;
d.WindowState = FormWindowState.Maximized;
d.ControlBox = false;
d.MinimizeBox = false;
d.MaximizeBox = false;
d.ShowIcon = false;
d.SizeGripStyle = SizeGripStyle.Hide;
d.FormBorderStyle = FormBorderStyle.None;

Share this post


Link to post
Share on other sites
"full screen windowed" mode, which is just windowed mode where your main window is resized to be the dimensions of the screen [/quote]

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!