Jump to content
  • Advertisement
Sign in to follow this  
AdamWebb

Fullscreen MDX

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

At the moment I'm only able to achieve fullscreen DirectX using C# via this method:
public GameForm()
{
	this.FormBorderstyle = FormBorderstyle.None;
	this.WindowState = FormWindowState.Maximized;		
}

public bool InitDirect3d()
{
	PresentParameters	presentParams = new PresentParameters();

	presentParams.Windowed = true;
	presentParams.SwapEffect = SwapEffect.Discard;

	d3dDevice = new Device( 0, DeviceType.Hardware, this,
		CreateFlags.SoftwareVertexProcessing, presentParams );

	return true;
}

This probably isn't the best way to go about it...Seeing as I have presentParams.Windowed set to true. I've searched the MSDN and the SDK docs but haven't found anything on this. Am I doing it right, or is there a better way?

Share this post


Link to post
Share on other sites
Advertisement
Hi there AdamWebb, How are you doing?

The Problem
Running MDX in fullscreen (creating a fullscreen window)

The Solution
You must remember that when you go fullscreen you will have to change a view present parameters.
These include
Windowed value to false.
Back buffer width, height.
and optionally your presentation interval.

Demo code

public void SetupPresentParams(bool fullscreen, Control control)
{
adapterInfo = Manager.Adapters[0]; //Helper class to gain access to information about the display adapter
presentParams = new PresentParameters();
presentParams.BackBufferCount = 1; //Number of backbuffers to create
presentParams.BackBufferFormat = adapterInfo.CurrentDisplayMode.Format; //The current format of the display device
presentParams.BackBufferWidth = control.Width;
presentParams.BackBufferHeight = control.Height;
presentParams.SwapEffect = SwapEffect.Discard; //How the backbuffer and the current display will be swapped
presentParams.AutoDepthStencilFormat = DepthFormat.D24S8; //24 bits for the depth and 8 bits for the stencil
presentParams.EnableAutoDepthStencil = true; //Let direct3d handle the depth buffers for the application
presentParams.Windowed = true;
if(fullscreen)
{
presentParams.Windowed = false; //is the application windowed or fullscreen
presentParams.BackBufferWidth = control.Width;
presentParams.BackBufferHeight = control.Height;
presentParams.PresentationInterval = PresentInterval.Immediate;
}
}




This is a simple example of how you would setup your fullscreen renderer. So you would pass the form/control to your renderer and if the device should be created in fullscreen or not.

I hope this helps.
Take care.

Share this post


Link to post
Share on other sites
Change that:
presentParams.Windowed = true;
to
presentParams.Windowed = false;

That should put you into real full-screen mode, as opposed to rendering on a maximized window. Its not quite the same thing, as when you are in actual full-screen mode, you have more or less full unrestricted access to the video card that you don't have to share with other running programs.
You'll also want to fill in the rest of the presentParams with appropriate values for your application. What those all are, is in the sdk, just do a search for presentation parameters.

Share this post


Link to post
Share on other sites
The code given works for me in full screen only if i set the windowed=true if i set it false i get an error. hmm...why?

Share this post


Link to post
Share on other sites
What Zmax says is true.

Whenever I use the source provided in the SDK, and modify the Windowed property to = false, the program encounters an error and exits?

Share this post


Link to post
Share on other sites
Quote:
Original post by andor
Change that:
presentParams.Windowed = true;
to
presentParams.Windowed = false;

That should put you into real full-screen mode, as opposed to rendering on a maximized window. Its not quite the same thing, as when you are in actual full-screen mode, you have more or less full unrestricted access to the video card that you don't have to share with other running programs.
You'll also want to fill in the rest of the presentParams with appropriate values for your application. What those all are, is in the sdk, just do a search for presentation parameters.


This is absolutely correct doing this will set it to full screen on load .. also if you are using the sample framework you can create a shortcut of your .exe and add -fullscreen to the shortcut and it will render it in fullscreen as well :[]

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!