Clear this up for me

Started by
1 comment, last by Axiverse 17 years, 9 months ago
I am not sure where I am supposed to be setting my screen size dimensions for DX, but my best guess as of now is the

D3DPRESENT_PARAMETERS 
//BackBufferWidth
//BackBufferHeight

sets the screen size for fullscreen rendering? If so then why does my call to d3d9->GetAdapterDisplayMode(D3DADAPTER_DEFAULT, &d3dDisplayMode); keep setting my size to 1600x1200 when I tell my app to init the window to 1024x768? I am confused to what is happening and have looked at examples and ran out of ideas... Thanks
Advertisement
Ok I think I got it, I was calling

d3d9->GetAdapterDisplayMode(D3DADAPTER_DEFAULT, &d3dDisplayMode);

and then sending the d3dDisplayMode to my D3DPRESENT_PARAMETERS back buffer width/height variables...

now I set my

D3DDISPLAYMODE d3dDisplayMode variable explictly and don't call

d3d9->GetAdapterDisplayMode(D3DADAPTER_DEFAULT, &d3dDisplayMode);

anymore and seems to work. Is this correct? If so I am assuming

d3d9->GetAdapterDisplayMode(D3DADAPTER_DEFAULT, &d3dDisplayMode);

just gets the current display mode regardless of what you setup the D3DDISPLAYMODE to if you send the returned value from GetAdapterDisplayMode to the back buffer width and height variables and don't explicitly set the values yourself... Thanks
Yes, back buffer width and back buffer height are the right properties to set. I don't know exactly what's wrong, cause I've never hand any problems. I assume that you are in fullscreen and are on the primary monitor. Also when are you calling that function? You might actually be getting the right resolution. Try to use the functions in the ID3D9Device instead. Try device.GetDisplayMode instead.

edit.

lol, I'm not sure what you're trying to do, but GetDisplayMode reads the current display mode, you don't need to use it when creating a device. You should just directly set the variables in PresentParams

This topic is closed to new replies.

Advertisement