Sign in to follow this  
MARS_999

Clear this up for me

Recommended Posts

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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this