Mercurial > sdl-ios-xcode
comparison test/testnative.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 | 240a7700a271 |
children | e8916fe9cfc8 |
comparison
equal
deleted
inserted
replaced
3684:cc564f08884f | 3685:64ce267332c6 |
---|---|
34 factory->DestroyNativeWindow(native_window); | 34 factory->DestroyNativeWindow(native_window); |
35 } | 35 } |
36 exit(rc); | 36 exit(rc); |
37 } | 37 } |
38 | 38 |
39 SDL_TextureID | 39 SDL_Texture * |
40 LoadSprite(SDL_WindowID window, char *file) | 40 LoadSprite(SDL_Window * window, char *file) |
41 { | 41 { |
42 SDL_Surface *temp; | 42 SDL_Surface *temp; |
43 SDL_TextureID sprite; | 43 SDL_Texture *sprite; |
44 | 44 |
45 /* Load the sprite image */ | 45 /* Load the sprite image */ |
46 temp = SDL_LoadBMP(file); | 46 temp = SDL_LoadBMP(file); |
47 if (temp == NULL) { | 47 if (temp == NULL) { |
48 fprintf(stderr, "Couldn't load %s: %s", file, SDL_GetError()); | 48 fprintf(stderr, "Couldn't load %s: %s", file, SDL_GetError()); |
67 /* We're ready to roll. :) */ | 67 /* We're ready to roll. :) */ |
68 return sprite; | 68 return sprite; |
69 } | 69 } |
70 | 70 |
71 void | 71 void |
72 MoveSprites(SDL_WindowID window, SDL_TextureID sprite) | 72 MoveSprites(SDL_Window * window, SDL_Texture * sprite) |
73 { | 73 { |
74 int i, n; | 74 int i, n; |
75 int window_w, window_h; | 75 int window_w, window_h; |
76 int sprite_w, sprite_h; | 76 int sprite_w, sprite_h; |
77 SDL_Rect *position, *velocity; | 77 SDL_Rect *position, *velocity; |
111 int | 111 int |
112 main(int argc, char *argv[]) | 112 main(int argc, char *argv[]) |
113 { | 113 { |
114 int i, done; | 114 int i, done; |
115 const char *driver; | 115 const char *driver; |
116 SDL_WindowID window; | 116 SDL_Window *window; |
117 SDL_TextureID sprite; | 117 SDL_Texture *sprite; |
118 int window_w, window_h; | 118 int window_w, window_h; |
119 int sprite_w, sprite_h; | 119 int sprite_w, sprite_h; |
120 SDL_Event event; | 120 SDL_Event event; |
121 | 121 |
122 if (SDL_VideoInit(NULL, 0) < 0) { | 122 if (SDL_VideoInit(NULL, 0) < 0) { |