Jump to content
  • Advertisement

Archived

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

doctorsixstring

D3D8 "SetDisplayMode()"

This topic is 5851 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 can I change the screen resolution for DirectGraphics? I have a basic skeleton set up that I have been using for a while, but when I switch to fullscreen, it retains the user''s desktop resolution. How can I adjust this? -Mike

Share this post


Link to post
Share on other sites
Advertisement
Hi, you''d do something like this.


  
ZeroMemory(&d3dpp, sizeof(d3dpp));
d3dpp.Windowed = false;
d3dpp.SwapEffect = D3DSWAPEFFECT_FLIP;
d3dpp.FullScreen_RefreshRateInHz = D3DPRESENT_RATE_DEFAULT;
d3dpp.FullScreen_PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT;
d3dpp.BackBufferWidth = 800;
d3dpp.BackBufferHeight = 600;
d3dpp.BackBufferFormat = D3DFMT_R5G6B5;
d3dpp.Flags = D3DPRESENTFLAG_LOCKABLE_BACKBUFFER;
//d3dpp.hDeviceWindow = G.g_hWnd;

g_ScreenFormat = D3DFMT_R5G6B5;


The main members here are "BackBufferWidth" and "BackBufferHeight". DXGraphics sets the primary display mode from these settings.

Share this post


Link to post
Share on other sites
Oh, of course. Now that I feel like an idiot, I see I have the following lines:


  
D3DDISPLAYMODE d3ddm;
m_pD3D->GetAdapterDisplayMode(D3DADAPTER_DEFAULT, &d3ddm);

present.BackBufferWidth = d3ddm.Width;
present.BackBufferHeight = d3ddm.Height;


So in other words, I was just setting the screen size to its current size, not a new size. Thanks, Redline!

-Mike

Share this post


Link to post
Share on other sites
@doctorsixstring: Don''t worry about feeling like an idiot. It happens to the best of us. You may have a few arrogant types give you heck every now and then, but most of us remember that we''ve been there. Heck, I''m STILL there .

Share this post


Link to post
Share on other sites
Yeah, don''t worry about it. DirectX is a large and complex system, sometimes we miss the little things, I know I have. In fact, I was just there a few weeks ago, and I have a game up and running. I decided to drop the default resolution to a lower one than the current, but I also have a BG that was significantly bigger than the backbuffer, so I needed to blit parts of it to the backbuffer. I eventually discovered it was CopyRects and a sperate storage surface that I needed.

Coming from DirectDraw 7 it was easy to overlook that nuance until I needed it.

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.

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!