Jump to content
  • Advertisement

Archived

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

Changing Resoltuions

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

How would I go about changing resolutions while the program is running? I tried pD3d->CreateDevice() again but with the present parameters structure having the new resolution, but then nothing will render because directx says that the vertex and index buffers used weren''t created with the same device and therefore cannot render the objects. Is there a simple way to setting the resolution? I took a look at the methods that IDirect3DDevice8 has, but I didn''t see any methods that may be related to changing resolution

Share this post


Link to post
Share on other sites
Advertisement
For my first game I was planning on doing it the cheap and easy way: save the configuration in a file or the registry, which includes the new resolution. Then restart the game.
If you are a beginner like me, you can do it that way. Alternatively, you can do it the proper way. That involves invalidating and destroying all your buffers and stuff, then creating them again. Quite messy apparently.


--------------------

Never eat anything bigger than your own head.

Share this post


Link to post
Share on other sites
have just a class wich hold "main menu" as well as "Option menu" where player can get to change the res. So you don''t need to deal with destroying/recreating in game object wich may be a pain.

So you only need to destroy/create few object like background panel, mouse sprite or so on.

When game start you simply delete this class and start the game''s one so your set with unusued object. Coming back to menu is just a matter of destroying the game''s class and recreate the menu''s one.

Just a thought this work fine for me.

Dan



Share this post


Link to post
Share on other sites
not sure but i tink u need to invalidate ur device object...call reset wif ur new present parameters with new resolution and den restore e objects(texture ,vb etc) again..

Share this post


Link to post
Share on other sites
Yes, about that; I am wondering if using the Device->Reset() function would be enough for changing the res, or you would still have to recreate all the buffers, etc?

Share this post


Link to post
Share on other sites
Sorry, I just look at the D3D Doc and here is what it says:

"Calling Reset causes all texture memory surfaces to be lost, managed textures to be flushed from video memory, and all state information to be lost. Before calling the Reset method for a device, an application should release any explicit render targets, depth stencil surfaces, additional swap chains and D3DPOOL_DEFAULT resources associated with the device."

So there is my answer

Share this post


Link to post
Share on other sites
Use D3DPOOL_MANAGED on all dx resources instead and DX will sort out lost textures and stuff for you. However I think it might use a bit more memory as I guess it keeps a system copy as well.

[The views stated herein do not necessarily represent the view of the company Eurocom ]

Eurocom Entertainment Software
www.Eurocom.co.uk

The Jackal

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!