#### Archived

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

# D3D8 "SetDisplayMode()"

This topic is 5930 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## 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 on other sites
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 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 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 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.

1. 1
2. 2
3. 3
Rutin
23
4. 4
5. 5
khawk
14

• 9
• 11
• 11
• 23
• 11
• ### Forum Statistics

• Total Topics
633653
• Total Posts
3013157
×