this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Updated clip-demo to test with virtual resolution.

+16 -7
+16 -7
demos/clip/main.c
··· 12 12 return -1; 13 13 14 14 printCurrentRenderer(); 15 - 15 + 16 16 { 17 17 GPU_Image* image; 18 18 float dt; ··· 49 49 vely[i] = 10 + rand() % screen->h / 10; 50 50 } 51 51 52 - GPU_SetClip(screen, 40, 40, 600, 300); 53 - 54 52 55 53 done = 0; 56 54 while (!done) ··· 73 71 if (numSprites > 0) 74 72 numSprites--; 75 73 } 74 + else if (event.key.keysym.sym == SDLK_SPACE) 75 + { 76 + if(screen->using_virtual_resolution) 77 + GPU_UnsetVirtualResolution(screen); 78 + else 79 + GPU_SetVirtualResolution(screen, 400, 400); 80 + } 76 81 } 77 82 } 78 83 ··· 85 90 x[i] = 0; 86 91 velx[i] = -velx[i]; 87 92 } 88 - else if (x[i] + image->w > screen->w) 93 + else if (x[i] + image->w > 800) 89 94 { 90 - x[i] = screen->w - image->w; 95 + x[i] = 800 - image->w; 91 96 velx[i] = -velx[i]; 92 97 } 93 98 ··· 96 101 y[i] = 0; 97 102 vely[i] = -vely[i]; 98 103 } 99 - else if (y[i] + image->h > screen->h) 104 + else if (y[i] + image->h > 600) 100 105 { 101 - y[i] = screen->h - image->h; 106 + y[i] = 600 - image->h; 102 107 vely[i] = -vely[i]; 103 108 } 104 109 } 105 110 106 111 GPU_Clear(screen); 107 112 113 + GPU_SetClip(screen, 40, 40, 600, 300); 108 114 for (i = 0; i < numSprites; i++) 109 115 { 110 116 GPU_Blit(image, NULL, screen, x[i], y[i]); ··· 112 118 113 119 GPU_Line(screen, 0, 0, screen->w, screen->h, lineColor); 114 120 GPU_Line(screen, 0, screen->h, screen->w, 0, lineColor); 121 + 122 + GPU_UnsetClip(screen); 123 + GPU_Rectangle(screen, 40, 40, 40 + 600, 40 + 300, lineColor); 115 124 116 125 GPU_Flip(screen); 117 126