This site is no longer active and is available for archival purposes only. Registration and login is disabled.

HI_RES_AWARE in runtime?


HI_RES_AWARE in runtime?

Postby Kak » Apr 12, 2008 @ 4:05pm

Hi all,

is there any way to revert pocketHAL from 480x640 to 240x320 with pocketHAL?

I already have too much versions to be compiled and I think it's a mess (thanks Microsoft) that you can't decide the screen resolution other than at compile time. I wouldn't care in smartphone, as I usually handle both resolutions at runtime, but 480x640 is too big to get a decent framerate.

TIA!
Kak

edit: extra question... is there any way to decide if a device has a pointing device or not?
In theory there should be no difference between WM6 standar and WM6 professional from PocketHAL's standpoint, isn't it? I mean, could be an app produced that works in both "smartphones" (no pointing devices) and "pocket PCs" (with pointing devices) ?

(I find microsoft messed it with standar/classic/professional once again)
User avatar
Kak
pm Member
 
Posts: 291
Joined: Jul 26, 2003 @ 12:24pm
Location: Zannarkand, Spira


Postby Kzinti » Apr 12, 2008 @ 9:19pm

Last edited by Kzinti on Apr 13, 2008 @ 12:35am, edited 1 time in total.
Kzinti
pm Member
 
Posts: 3238
Joined: Jan 13, 2002 @ 5:23am


Postby Kak » Apr 12, 2008 @ 11:06pm

User avatar
Kak
pm Member
 
Posts: 291
Joined: Jul 26, 2003 @ 12:24pm
Location: Zannarkand, Spira


Postby hrissan » May 12, 2008 @ 7:53am

I can tell you what we do in our iwindowsmobile.com software. We compile SINGLE version - target Smartphone 2003 SDK. Then all functions absent in Smartphone 2003 is loaded via LoadLibrary/FindProcAddress. We have single EXE file which runs on many devices (older/newer smartphones/pockets).

Regarding pixel doubling here what we do - we have written a special versions of Blit/Stretch functions which can do pixel doubling. So we scale up all coordinates, and also we scale up font size.

So on VGA we have obviously scaled up images, but we also get very smooth fonts... Pixel doubling on final picture is just wasting nice VGA screens, don;t do it. :)
hrissan
pm Member
 
Posts: 30
Joined: Mar 10, 2007 @ 1:38pm


Postby hrissan » May 12, 2008 @ 8:42am

Also to detect between smartphone/pocket we use

wchar_t strbuild[ 20 ] = {0};
SystemParametersInfo(SPI_GETPLATFORMTYPE, 20, strbuild, 0);
std::wstring str( strbuild.get_data() );
return os::tolower(str) == L"smartphone";

And to detect screen parameters, we use

ScreenResolution Application::get_shell_resolution()
{
ScreenResolution result;
os::HDCScreen scr;

result.dpi = GetDeviceCaps( scr.get_hdc(), LOGPIXELSY );
result.size = Point(GetDeviceCaps(scr.get_hdc(), HORZRES), GetDeviceCaps(scr.get_hdc(), VERTRES));
result.orientation = PHAL::GetShellOrientation();
result.client_area_size = result.size;
return result;
}

Where ScreenResolution is ordinary struct and HDCScreen is C++ wrapper around GetDC(0)

And later when we need to decide on scaling, we use

scale_shift = 0;
if( screen_resolution.dpi >= 192 )
scale_shift = 1;

scale_shift is just log2(scale) so we can use x <<= scale_shift everywhere.

This simple "if" is in accordance with Microsoft documentation - DPI has nothing to do with actual size of pixels, it's just a flag which can be used to detect VGA screens.
hrissan
pm Member
 
Posts: 30
Joined: Mar 10, 2007 @ 1:38pm


Return to PocketFrog & PocketHAL


Sort


Forum Description

SDKs for fast and robust device-independent access to Pocket PC display hardware.

Moderators:

sponge, Kzinti

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron