GP32 Mean GpTransBlt


rcx21000

Well-Known Member
Joined
Mar 26, 2003
Messages
1,624
Age
54
Website
Visit site
Whenever I try to bitblt something on the screen, only the BG and the last thing I bitblt dosen't flicker :blink: The other things flicker soooo bad that soon I can't see them :angry: Here is the code:

GpBitBlt(0, &gpsurface[nflip], 0, 0, 320, 240, BG, 0, 0, 320, 240); //this is the BG
GpTransBlt(0, &gpsurface[nflip], X, Y, 10, 10, pic, 0, 0, 10, 10, 0xFF); //this flickers badly
GpTransBlt(0, &gpsurface[nflip], X, Y, 10, 10, pic2, 0, 0, 10, 10, 0xFF); //this dosen't

WHY?
 
Actually it seems like it will bitblt the first thing right, but some part of the BG (mabye 100sq.px.) is being blitted AFTER the sprites are finished????? Because the second one is lower than the first, and if I switch them, the first one still flickers away?????
 
New update: It is actually a bar going down all the way (pic2 is also to the right of pic) and when I don't use a background it works PERFECT!! What is happening, is it starting the sprite bitblt before it finishes the BG or what??? And most important HOW DO I FIX IT??
 
I'm not, I found out now that it is a problem with the SDK functions :( No fix, but if I do a delay after surface flip (hard to find out exactly, I need to fiddle with it) I can evenly spread out all the flickers to a almost non-noticiable level all over the screen.
 
erm...

your code should look similar to this

Code:
nflip = 1;
GpSurfaceSet(&gpDraw[0]);

.
.
// game loop
while(1) {
 GpRectFill(NULL, &gpDraw[nflip], (p->x - 16) / 16 * 16, p->y / 16 * 16, 16, 16,
   tile_col[map[(p->x - 1) >> 4][p->y >> 4]] * 128); // some operation - do this to [nflip]
  GpSurfaceFlip(&gpDraw[nflip++]);
  nflip &= 0x01;
}
 
Back
Top