Page 1 of 1

Treo 700w/wx screen and gapi problem.

PostPosted: Nov 13, 2007 @ 12:17pm
by Fredo1975
Hi,

I have a issue with the treo 700w/wx device and gapi.
Apperently, their is some problem with the screen address and gapi.

My applications work great on many squared devices and also on the treo 750v, but not on the 700w/wx and I don't have this device to test by myself.

I received many message for my applications from 700w/wx users, they told me that the problem made a white screen and then a error message appeared.

Here is a code to determine what address and how gapi work.
I also attached a precompiled file to this message.

r=GXOpenDisplay(hWnd,dwFlags);
if (r!=0)
{
WORD VDRAM;
HDC hdc = GetDC(NULL);
ExtEscape(hdc, GETRAWFRAMEBUFFER, 0, NULL,
sizeof(RawFrameBufferInfo), (char *) &rfbi);
ReleaseDC(NULL, hdc);

VDRAM=GXIsDisplayDRAMBuffer();

if (!VDRAM) pBuffer = (void *)GXBeginDraw();
else pBuffer = rfbi.pFramePointer;

stream = _wfopen(TEXT("result.txt"), TEXT("w"));
fprintf(stream,"Hardware Information \n");
fprintf(stream,"==================== \n");
fprintf(stream,"\n");
fprintf(stream,"[BEGIN]\n");
fprintf(stream,"wFormat =%d\n",rfbi.wFormat);
fprintf(stream,"wBPP =%d\n",rfbi.wBPP);
fprintf(stream,"pFramePointer =%p\n",rfbi.pFramePointer);
fprintf(stream,"cxStride =%d\n",rfbi.cxStride);
fprintf(stream,"cyStride =%d\n",rfbi.cyStride);
fprintf(stream,"cxPixels =%d\n",rfbi.cxPixels);
fprintf(stream,"cyPixels =%d\n",rfbi.cyPixels);
fprintf(stream,"VDRAM =%d\n",VDRAM);
fprintf(stream,"GetSystemMetrics CX =%d\n",GetSystemMetrics(SM_CXSCREEN));
fprintf(stream,"GetSystemMetrics CY =%d\n",GetSystemMetrics(SM_CYSCREEN));
fprintf(stream,"\n");
fprintf(stream,"[END]\n");
fprintf(stream,"--------------------------------------\n");
fclose( stream );
}

I've got this result on the Treo 750v.
Hardware Information
===============
[BEGIN]
wFormat =1
wBPP =16
pFramePointer =4C800000
cxStride =2
cyStride =480
cxPixels =240
cyPixels =240
VDRAM =0
GetSystemMetrics CX =240
GetSystemMetrics CY =240
[END]

I someone could try this code, maybe I could reach a small deduction and fix the damn 700w bug.
Or if someone have the solution/information about the gapi 700w/wx screen issue, that would be more that usefull.

Thanks,
Fredo

PostPosted: Nov 13, 2007 @ 5:59pm
by Kzinti
There is nothing wrong with the Treo 700w. Your code doesn't look correct: you are mixing GAPI and GETRAWFRAMEBUFFER APIs. You also assume that GETRAWFRAMEBUFFER will work if GXOpenDisplay() does: there is no relation between the two. It also sounds like you forgot to call GXCloseDisplay() in case you use GETRAWFRAMEBUFFER.

I suggest you remove all GAPI code and just go with GETRAWFRAMEBUFFER. If *that* fails, then maybe try GAPI (although that's a bad idea with all the devices doing emulation behind your back).

PostPosted: Nov 13, 2007 @ 9:48pm
by Fredo1975
Thanks for your reply,

This isn't the full code, I only put the interested part.
The complet code work great on many other devices.

Today I have received some feedback, it's appeared that the VDRAM is different in the treo 700w.