Jump to content
  • Advertisement
Sign in to follow this  

Toggling fullscreen

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

Hi! I have never really understood how to manage a fullscreen toggling, I'm currently doing something very simple, and possibly as stupid :
//Make a copy of the D3DPP currently used
//Set the windowed flag to false
d3dpp.Windowed = FALSE;
//Hide the cursor
//Reset device using the new params
if( FAILED( _Renderer->_D3DDevice->Reset(&d3dpp) ) )
	FE2D_LOG(40,"Could not go fullscreen");
	return false;
//It worked, set the D3DPP currently used to the temp one
_D3DPP = d3dpp;

I get the "Could not go fullscreen" warning and then all calls to SetFVF and other things fail. I'm pretty sure I'm not doing it the good way. BTW, I have set the D3DPP.BackBufferFormat to R5G6B5 and not unknown. And my window style is the following : _Windowstyle = WS_OVERLAPPED | WS_CAPTION | WS_MINIMIZEBOX | WS_SYSMENU | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN; I'm surely not doing it the good way, could anyone give me a tip or point me a tutorial?

Share this post

Link to post
Share on other sites
Hum... Apron Tutorials completely deletes the window and then re-creates it. There must be an easier way to do this, without losing the direct3D device, no?

Share this post

Link to post
Share on other sites
In dx every creation function have D3DPOOL Pool option. This option tell where the resources will place.

d3dDevice->CreateVertexBuffer( dwNumPolygonIndex*3*sizeof(CUSTOMVERTEX),
0, VertexFVF,
D3DPOOL_SYSTEMMEM, <--- <|0_-|>

typedef enum D3DPOOL
D3DPOOL_DEFAULT = 0,//Resources placed in agp memory. You must release before reset.
D3DPOOL_MANAGED = 1,//... not need to release resources.
D3DPOOL_SYSTEMMEM = 2,... not need to release resources.
D3DPOOL_SCRATCH = 3, ... not need to release resources.
D3DPOOL_FORCE_DWORD = 0x7fffffff,

if your resources created in the agp memory you must release resources before reset. Run the reset. Then reload the resources.
if resources created in system memory not neet to release an reload resources. Reset will run directly.

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!