comparison Xcode-iPhoneOS/Demos/src/mixer.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 20326ba2bda2
children 06c7423f8c60
comparison
equal deleted inserted replaced
3684:cc564f08884f 3685:64ce267332c6
272 int 272 int
273 main(int argc, char *argv[]) 273 main(int argc, char *argv[])
274 { 274 {
275 275
276 int done; /* has user tried to quit ? */ 276 int done; /* has user tried to quit ? */
277 SDL_WindowID windowID; /* our main window */ 277 SDL_Window *window; /* main window */
278 SDL_Event event; 278 SDL_Event event;
279 Uint32 startFrame; /* holds when frame started processing */ 279 Uint32 startFrame; /* holds when frame started processing */
280 Uint32 endFrame; /* holds when frame ended processing */ 280 Uint32 endFrame; /* holds when frame ended processing */
281 Uint32 delay; /* calculated delay, how long should we wait before next frame? */ 281 Uint32 delay; /* calculated delay, how long should we wait before next frame? */
282 282
283 if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO) < 0) { 283 if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO) < 0) {
284 fatalError("could not initialize SDL"); 284 fatalError("could not initialize SDL");
285 } 285 }
286 windowID = 286 window =
287 SDL_CreateWindow(NULL, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 287 SDL_CreateWindow(NULL, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT,
288 SDL_WINDOW_OPENGL | SDL_WINDOW_BORDERLESS); 288 SDL_WINDOW_OPENGL | SDL_WINDOW_BORDERLESS);
289 SDL_CreateRenderer(windowID, 0, 0); 289 SDL_CreateRenderer(window, 0, 0);
290 290
291 /* initialize the mixer */ 291 /* initialize the mixer */
292 SDL_memset(&mixer, 0, sizeof(mixer)); 292 SDL_memset(&mixer, 0, sizeof(mixer));
293 /* setup output format */ 293 /* setup output format */
294 mixer.outputSpec.freq = 44100; 294 mixer.outputSpec.freq = 44100;