comparison test/testsprite2.c @ 1903:f132024010be

More of the Direct3D renderer is implemented, I'm not sure why it's not showing texture copies yet...
author Sam Lantinga <slouken@libsdl.org>
date Fri, 14 Jul 2006 06:40:53 +0000
parents c121d94672cb
children 1a713f9d1f71
comparison
equal deleted inserted replaced
1902:eb2891493b66 1903:f132024010be
3 #include <stdlib.h> 3 #include <stdlib.h>
4 #include <time.h> 4 #include <time.h>
5 5
6 #include "SDL.h" 6 #include "SDL.h"
7 7
8 #define NUM_WINDOWS 4 8 #define NUM_WINDOWS 1
9 #define WINDOW_W 640 9 #define WINDOW_W 640
10 #define WINDOW_H 480 10 #define WINDOW_H 480
11 #define NUM_SPRITES 100 11 #define NUM_SPRITES 100
12 #define MAX_SPEED 1 12 #define MAX_SPEED 1
13 #define BACKGROUND 0x00FFFFFF 13 #define BACKGROUND 0x00FFFFFF
89 /* Query the sizes */ 89 /* Query the sizes */
90 SDL_GetWindowSize(window, &window_w, &window_h); 90 SDL_GetWindowSize(window, &window_w, &window_h);
91 91
92 /* Move the sprite, bounce at the wall, and draw */ 92 /* Move the sprite, bounce at the wall, and draw */
93 n = 0; 93 n = 0;
94 for (i = 0; i < num_sprites; ++i) { 94 SDL_RenderFill(NULL, BACKGROUND);
95 position = &positions[i]; 95 /*
96 SDL_RenderFill(position, BACKGROUND); 96 for (i = 0; i < num_sprites; ++i) {
97 } 97 position = &positions[i];
98 SDL_RenderFill(position, BACKGROUND);
99 }
100 */
98 for (i = 0; i < num_sprites; ++i) { 101 for (i = 0; i < num_sprites; ++i) {
99 position = &positions[i]; 102 position = &positions[i];
100 velocity = &velocities[i]; 103 velocity = &velocities[i];
101 position->x += velocity->x; 104 position->x += velocity->x;
102 if ((position->x < 0) || (position->x >= (window_w - sprite_w))) { 105 if ((position->x < 0) || (position->x >= (window_w - sprite_w))) {
235 done = 1; 238 done = 1;
236 break; 239 break;
237 } 240 }
238 break; 241 break;
239 case SDL_KEYDOWN: 242 case SDL_KEYDOWN:
240 /* Any keypress quits the app... */ 243 ///* Any keypress quits the app... */
244 break;
241 case SDL_QUIT: 245 case SDL_QUIT:
242 done = 1; 246 done = 1;
243 break; 247 break;
244 default: 248 default:
245 break; 249 break;