comparison test/testintersections.c @ 3685:64ce267332c6

Switched from SDL_WindowID and SDL_TextureID to SDL_Window* and SDL_Texture* for code simplicity and improved performance.
author Sam Lantinga <slouken@libsdl.org>
date Thu, 21 Jan 2010 06:21:52 +0000
parents f638ded38b8a
children 3e69e077cb95
comparison
equal deleted inserted replaced
3684:cc564f08884f 3685:64ce267332c6
18 static int current_alpha = 255; 18 static int current_alpha = 255;
19 static int current_color = 255; 19 static int current_color = 255;
20 static SDL_BlendMode blendMode = SDL_BLENDMODE_NONE; 20 static SDL_BlendMode blendMode = SDL_BLENDMODE_NONE;
21 21
22 void 22 void
23 DrawPoints(SDL_WindowID window) 23 DrawPoints(SDL_Window * window)
24 { 24 {
25 int i; 25 int i;
26 int x, y; 26 int x, y;
27 int window_w, window_h; 27 int window_w, window_h;
28 28
84 return ++num_lines; 84 return ++num_lines;
85 } 85 }
86 86
87 87
88 void 88 void
89 DrawLines(SDL_WindowID window) 89 DrawLines(SDL_Window * window)
90 { 90 {
91 int i; 91 int i;
92 int x1, y1, x2, y2; 92 int x1, y1, x2, y2;
93 int window_w, window_h; 93 int window_w, window_h;
94 94
137 137
138 return ++num_rects; 138 return ++num_rects;
139 } 139 }
140 140
141 static void 141 static void
142 DrawRects(SDL_WindowID window) 142 DrawRects(SDL_Window * window)
143 { 143 {
144 int i; 144 int i;
145 int window_w, window_h; 145 int window_w, window_h;
146 146
147 /* Query the sizes */ 147 /* Query the sizes */
154 } 154 }
155 SDL_SetRenderDrawBlendMode(SDL_BLENDMODE_NONE); 155 SDL_SetRenderDrawBlendMode(SDL_BLENDMODE_NONE);
156 } 156 }
157 157
158 static void 158 static void
159 DrawRectLineIntersections(SDL_WindowID window) 159 DrawRectLineIntersections(SDL_Window * window)
160 { 160 {
161 int i, j, window_w, window_h; 161 int i, j, window_w, window_h;
162 162
163 /* Query the sizes */ 163 /* Query the sizes */
164 SDL_GetWindowSize(window, &window_w, &window_h); 164 SDL_GetWindowSize(window, &window_w, &window_h);
184 184
185 SDL_SetRenderDrawBlendMode(SDL_BLENDMODE_NONE); 185 SDL_SetRenderDrawBlendMode(SDL_BLENDMODE_NONE);
186 } 186 }
187 187
188 static void 188 static void
189 DrawRectRectIntersections(SDL_WindowID window) 189 DrawRectRectIntersections(SDL_Window * window)
190 { 190 {
191 int i, j; 191 int i, j;
192 192
193 SDL_SetRenderDrawBlendMode(SDL_BLENDMODE_NONE); 193 SDL_SetRenderDrawBlendMode(SDL_BLENDMODE_NONE);
194 194
322 } 322 }
323 break; 323 break;
324 case SDL_WINDOWEVENT: 324 case SDL_WINDOWEVENT:
325 switch (event.window.event) { 325 switch (event.window.event) {
326 case SDL_WINDOWEVENT_EXPOSED: 326 case SDL_WINDOWEVENT_EXPOSED:
327 SDL_SelectRenderer(event.window.windowID); 327 SDL_SelectRenderer(SDL_GetWindowFromID(event.window.windowID));
328 SDL_SetRenderDrawColor(0xA0, 0xA0, 0xA0, 0xFF); 328 SDL_SetRenderDrawColor(0xA0, 0xA0, 0xA0, 0xFF);
329 SDL_RenderClear(); 329 SDL_RenderClear();
330 break; 330 break;
331 } 331 }
332 break; 332 break;