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

Need help using memcpy with GAPI


Need help using memcpy with GAPI

Postby Vickerto » Sep 12, 2001 @ 5:56pm

I need some help using memcpy with my GAPI app.  I am using memcpy to copy a back buffer to video memory.  It works great, but I am experiencing a strange occurance.  The first vertical row of pixels on the screen is not being drawn (it just shows up as a white column of pixels).  Has anyone run into this or does anyone know what could be happening?  Thanks in advance.<br><br>Tom
Vickerto
pm Member
 
Posts: 4
Joined: Aug 23, 2001 @ 7:29am


Re: Need help using memcpy with GAPI

Postby Paul » Sep 12, 2001 @ 5:59pm

don't ask me, i just work here.
Paul
pm Insider
 
Posts: 9835
Joined: Apr 2, 2001 @ 3:15pm
Location: California


Re: Need help using memcpy with GAPI

Postby Digby » Sep 12, 2001 @ 6:38pm

If the display is native landscape (iPaq) then the address returned by GXBeginDraw is at the 0,0 position in portrait mode.  In order to get the start of display RAM, you need the address of 0,0 in landscape mode (lower left pixel in portrait).<br><br>This will give you the correct address for landscape native displays:<br><br>WORD* pwScrBuf = (WORD*)GXBeginDraw() - 319;<br><br>
Digby
pm Insider
 
Posts: 1011
Joined: Apr 29, 2001 @ 1:53pm


Re: Need help using memcpy with GAPI

Postby Vickerto » Sep 12, 2001 @ 7:17pm

Looks good.  Thanks.  This code now works on the iPaq, but I am assuming it needs to change for MIPS and SH3, correct?  Also, I am now getting exception errors when I blit to the far right side of the screen.  I am guessing that this is because I am not doing any clipping as of yet, any input?  Thanks.<br><br>Tom
Vickerto
pm Member
 
Posts: 4
Joined: Aug 23, 2001 @ 7:29am


Re: Need help using memcpy with GAPI

Postby Digby » Sep 12, 2001 @ 8:19pm

You should not assume that one device or another is landscape, portrait, or a particular size.  Call GXGetDisplayProperties to query what the particular device supports.<br><br>On a native landscape display oriented as portrait, the right edge is the end of the linear frame buffer.  This means that if you copy memory to the right of the edge, you'll be writing into memory that doesn't belong to your process.  You'll end up corrupting the display controller or if you're lucky generating an access violation.  Add some clipping code and you shouldn't see this problem.<br><br><br><br>
Digby
pm Insider
 
Posts: 1011
Joined: Apr 29, 2001 @ 1:53pm


Re: Need help using memcpy with GAPI

Postby David C. Allen » Sep 22, 2001 @ 2:14pm

Tom could a get a small snippit of code showing how you are memcpying to the GAPI display memory? I have been trying to figure out how to do something like bitblit to the GAPI memory for quite some time.<br><br>Thanks!
David C. Allen
 


Return to Windows Mobile


Sort


Forum Description

A discussion forum for mobile device developers on the Windows Mobile platform. Any platform specific topics are welcome.

Moderators:

Dan East, sponge, Digby, David Horn, Kevin Gelso, RICoder

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