Page 1 of 1

Direct3D mobile exclusive mode issues

PostPosted: Jan 7, 2008 @ 6:23pm
by Cardinal
So after alot of twiddling around with D3D Mobile I have learnt a few things. In the call to create device, the parameters are pretty picky.

For instance, you should enumerate all depth formats to see which is available and then pick one. On some devices D16 is not available yet D24S8 is!

What I'm curious about is why D3DMPRESENT_PARAMETERS.Windowed set to TRUE doesn't seem to work on any device? Can you not do full screen exclusive mode in D3D mobile?

PostPosted: Jan 7, 2008 @ 10:16pm
by Digby
The capabilities vary between D3DM drivers. Your app shouldn't assume any particular display format or rendering capability - look at the driver caps and supported surface formats prior to creating the device.

You should be able to create a D3DM exclusive mode device, although D3DMPRESENT_PARAMETERS::Windowed would be set to FALSE, not TRUE, in order to do this.
You'll also need to initialize all of the members of the D3DMPRESENT_PARAMETERS structure prior to calling CreateDevice. If you're creating a windowed mode device, you can leave most of these fields set to zero and the device will be created using the current screen formats and window size.

What error is being returned when CreateDevice fails?

PostPosted: Jan 7, 2008 @ 10:50pm
by Cardinal
Yes my bad its when window is set to FALSE (to indicate exclusive full screen mode) is when I have issues.

Initially it was due to the depth-buffer choosen on various devices. So I enumerate all available ones and either allow the app to select one or I have the startup code pick one.

Aren't all displays on windows mobile RGB565? Would that not be what I should set the back buffer format too?

The error I usually get is D3DMERR_INVALIDCALL... but it all works fine (across all my test phones) in window mode.

PostPosted: Jan 8, 2008 @ 9:23pm
by Digby
What happens when you run your app on the D3DM Reference driver?

Can you post the values of the entire D3DMPRESENT_PARAMETERS struct and the params you're passing to CreateDevice when attempting to create a fullscreen exclusive mode device?

PostPosted: Jan 9, 2008 @ 8:16pm
by Cardinal

PostPosted: Jan 15, 2008 @ 1:34am
by Digby
Yes, the D3DM Reference driver is slow, but that's not the point. Since the Reference driver support practically every format and rendering capability, if your code works on this driver then it's probably something you've taken for granted with the system D3DM driver, rather than testing the driver caps prior to creating the device. The D3DM Reference driver is a development tool to be used to verify driver bugs and to ensure that your code runs on devices that have different capabilities compared to a single device's system driver.


In the code that you posted, you've set the Windowed parameter to TRUE. That isn't going to create a fullscreen device. Please post the values you're sending to CreateDevice for the fullscreen exclusive mode case.