To optimize some code I though of writing my own "blit" routines.
But somehow I can't figure out how the physical screen is organised.
Code used, but doesn't look the same when I simply use GpBitBlt
This is the screen you would expect, same layout as a 320x240 image
But it doesn't seem to be :unsure:
[edit]Corrected the image coordinates[/edit]
But somehow I can't figure out how the physical screen is organised.
Code used, but doesn't look the same when I simply use GpBitBlt
Code:
dest=gpDraw[nflip].ptbuffer;
bg=background;
for(y=0;ymax<240;y++) {
for(x=0;x<320;x++){
/* formula to convert to physical screen layout */
*(dest+x*240 + 240-1-y)=*(bg++);
}
}
This is the screen you would expect, same layout as a 320x240 image
Code:
0,0 319,0
+------------------+
| |
| |
| |
+------------------+
0,239 319,239
[edit]Corrected the image coordinates[/edit]