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

Fastest way to set a specific pixel in screen memory


Fastest way to set a specific pixel in screen memory

Postby rangers99 » Jan 23, 2003 @ 6:17am

Hi, Im still getting to grips with GAPI programming!

Assume I want to set the pixel (u,v) to the color c. What is the quickest way to do this? Is the following code reasonable?

============================

unsigned short * pusLine = (unsigned short *)GXBeginDraw();
if (pusLine == NULL) return false;
y = 0;
while(y<v)
{
pusLine += g_gxdp.cbyPitch >> 1;
++y;
}

unsigned short *pusDest = pusLine;
x = 0;
while(x < u)
{
pusDest += g_gxdp.cbxPitch >> 1;
++x;
}
*pusDest = c;
rangers99
pm Member
 
Posts: 7
Joined: Jan 20, 2003 @ 9:45am


Postby refractor » Jan 23, 2003 @ 8:44am

User avatar
refractor
pm Insider
 
Posts: 2304
Joined: Feb 5, 2002 @ 1:12pm
Location: Luxembourg


Postby rangers99 » Jan 24, 2003 @ 6:24am

rangers99
pm Member
 
Posts: 7
Joined: Jan 20, 2003 @ 9:45am


Postby gamefreaks » Jan 25, 2003 @ 12:47pm

What if everything is an illusion and nothing exists? In that case, I definitely overpaid for my carpet. -Woody Allen
User avatar
gamefreaks
pm Insider
 
Posts: 466
Joined: Oct 20, 2001 @ 8:52pm
Location: Leicester, England


Postby Digby » Jan 25, 2003 @ 11:12pm

If you are writing to the memory addressed by the value returned by GXBeginDraw AND GXIsDisplayDRAMBuffer returns a non-zero value, then you must call GXEndDraw each frame, regardless of the platform.
Digby
pm Insider
 
Posts: 1011
Joined: Apr 29, 2001 @ 1:53pm


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