Mercurial > sdl-ios-xcode
comparison test/testdraw2.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 | 27ab20a36eba |
comparison
equal
deleted
inserted
replaced
3684:cc564f08884f | 3685:64ce267332c6 |
---|---|
17 static int current_alpha = 255; | 17 static int current_alpha = 255; |
18 static int current_color = 255; | 18 static int current_color = 255; |
19 static SDL_BlendMode blendMode = SDL_BLENDMODE_NONE; | 19 static SDL_BlendMode blendMode = SDL_BLENDMODE_NONE; |
20 | 20 |
21 void | 21 void |
22 DrawPoints(SDL_WindowID window) | 22 DrawPoints(SDL_Window * window) |
23 { | 23 { |
24 int i; | 24 int i; |
25 int x, y; | 25 int x, y; |
26 int window_w, window_h; | 26 int window_w, window_h; |
27 | 27 |
62 } | 62 } |
63 SDL_SetRenderDrawBlendMode(SDL_BLENDMODE_NONE); | 63 SDL_SetRenderDrawBlendMode(SDL_BLENDMODE_NONE); |
64 } | 64 } |
65 | 65 |
66 void | 66 void |
67 DrawLines(SDL_WindowID window) | 67 DrawLines(SDL_Window * window) |
68 { | 68 { |
69 int i; | 69 int i; |
70 int x1, y1, x2, y2; | 70 int x1, y1, x2, y2; |
71 int window_w, window_h; | 71 int window_w, window_h; |
72 | 72 |
116 } | 116 } |
117 SDL_SetRenderDrawBlendMode(SDL_BLENDMODE_NONE); | 117 SDL_SetRenderDrawBlendMode(SDL_BLENDMODE_NONE); |
118 } | 118 } |
119 | 119 |
120 void | 120 void |
121 DrawRects(SDL_WindowID window) | 121 DrawRects(SDL_Window * window) |
122 { | 122 { |
123 int i; | 123 int i; |
124 SDL_Rect rect; | 124 SDL_Rect rect; |
125 int window_w, window_h; | 125 int window_w, window_h; |
126 | 126 |
247 CommonEvent(state, &event, &done); | 247 CommonEvent(state, &event, &done); |
248 switch (event.type) { | 248 switch (event.type) { |
249 case SDL_WINDOWEVENT: | 249 case SDL_WINDOWEVENT: |
250 switch (event.window.event) { | 250 switch (event.window.event) { |
251 case SDL_WINDOWEVENT_EXPOSED: | 251 case SDL_WINDOWEVENT_EXPOSED: |
252 SDL_SelectRenderer(event.window.windowID); | 252 SDL_SelectRenderer(SDL_GetWindowFromID(event.window.windowID)); |
253 SDL_SetRenderDrawColor(0xA0, 0xA0, 0xA0, 0xFF); | 253 SDL_SetRenderDrawColor(0xA0, 0xA0, 0xA0, 0xFF); |
254 SDL_RenderClear(); | 254 SDL_RenderClear(); |
255 break; | 255 break; |
256 } | 256 } |
257 break; | 257 break; |