PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

DirectDraw on WM5/6

We currently have 3 phones we are deploying to - an HTC Dash (WM5), Motorola Q (WM5), and Samsung Blackjack (WM6).

Using openmethod = DOM_DIRECTDRAW and surfacedefault = EST_SYSTEMAPI in the display parameters we are able to get access to a DirectDraw surface through GetSysApiSurface() on the Dash, but on the Q/Blackjack it returns null, suggesting that DirectDraw is not getting used.

What sort of factors aside from the display flags would impact whether DirectDraw is invoked? It's odd that we are getting DD on one WM5 machine but not on the other WM5 or the WM6.

The end goal here is to use the DirectDraw API to render Windows fonts onto an Edge surface - we of course have the fallback of using bitmap fonts but we'd like to avoid them if possible.
Hi Alanhorne,

If there is a problem opening the display in DirectDraw, it tries to use different methods. However, it's strange that the Windows Mobile 5+ devices can't open DirectDraw.

Can you try creating your surface using EST_HARDWARE and see if you notice any difference?
First I'd like to correct some errors in what I posted - the Dash is WM6 (not WM5) and the Blackjack does manage to get DirectDraw surface access but goes into some sort of odd crash/lockup state - I haven't pinned down the exact cause of this, though.

I just ran some tests with every combination of DOM_DIRECTDRAW / DOM_DEFAULT and EST_SYSMEMORY / EST_SYSTEMAPI / EST_HARDWARE. The only combination that works at all is DOM_DIRECTDRAW + EST_SYSTEMAPI, and it only works on the Dash. (It half-works on the Blackjack too as I mentioned earlier.)
Hi Alanhorne,

Can you confirm that the default display settings doesn't work on the BlackJack and the Motorola Q? Could you rebuild the helloworld sample using the EDGELIB Builder and post the results?
By "default settings", do you mean a non-DirectDraw display mode? If so, that is not a problem - we are able to get a workable non-DirectDraw display on all the WM phone models we have.

The problem is that we are considering the use of DirectDraw functions to accomplish certain tasks (TTF font rendering, for example) but we are unable to get DirectDraw rendering working on anything but the Dash.

If we are unable to get DirectDraw working we will use bitmap fonts, most likely with the Edge bitmap font functions as the back end.
Hi Alanhorne,

The default settings are DOM_DEFAULT and EST_SYSTEMAPI. In some cases DOM_DEFAULT does open a DirectDraw display mode, if the framebuffer is unavailable. It could be, that it can open the DirectDraw display mode on your devices, but not create a native surface.

Can you post your EDGELIB framework and display configuration here?
http://www.edgelib.com/index.php?node=1141 indicates that the default settings for openmethod and surfacedefault are DOM_DEFAULT and EST_SYSMEMORY.

We are currently using this display configuration:
Code:
pConfig->icon = mIconResource;
pConfig->width = GetSystemMetrics( SM_CXSCREEN );
pConfig->height = GetSystemMetrics( SM_CYSCREEN );
pConfig->orientation = DOR_AUTO;
pConfig->openmethod = DOM_DIRECTDRAW;
pConfig->engineconsole = false;
pConfig->fullscreen = true;
pConfig->fullscreenmouse = true;

All other display settings are unchanged (left as default), and the framework config is entirely left as default. This configuration set does not give us a DirectDraw surface on any of the three devices - GetSysApiSurface() returns null.

For testing I set surfacedefault to EST_SYSTEMAPI, which seemed to work on the Dash and Blackjack - with that setting the application title bar appeared over the top of the application, which is different behavior than we get ordinarily. The Dash would otherwise behave normally, but the Blackjack would lock up for minutes at a time.

So - while I have not confirmed for sure that the opened display is or is not DirectDraw, the fact that there is different behavior and that we are able to access a DirectDraw surface when we ordinarily are not able to leads me to believe that it is using DirectDraw where it wasn't before.
Hi Alanhorne,

You're correct, EST_SYSMEMORY is the default setting. The reason is that EST_SYSTEMAPI creates a hardware surface on Windows Mobile, which slows down the library.

If all devices operate correctly with DOM_DIRECTDRAW and EST_SYSMEMORY, I recommend the following:
- Create a new temporary surface, you can specify EST_SYSTEMAPI to override the default
- Call GetSysApiSurface() on that and see if you get the DirectDraw surface

Please note that DirectDraw might be buggy on some devices.