… | |
… | |
277 | { |
277 | { |
278 | SDL_UserEvent ev; |
278 | SDL_UserEvent ev; |
279 | |
279 | |
280 | ev.type = SDL_USEREVENT; |
280 | ev.type = SDL_USEREVENT; |
281 | ev.code = 1; |
281 | ev.code = 1; |
282 | ev.data1 = channel; |
282 | ev.data1 = (void *)(long)channel; |
283 | ev.data2 = 0; |
283 | ev.data2 = 0; |
284 | |
284 | |
285 | SDL_PushEvent ((SDL_Event *)&ev); |
285 | SDL_PushEvent ((SDL_Event *)&ev); |
286 | } |
286 | } |
287 | |
287 | |
… | |
… | |
501 | hv_store (hv, "button", 6, newSViv (ev.button.button), 0); |
501 | hv_store (hv, "button", 6, newSViv (ev.button.button), 0); |
502 | hv_store (hv, "state", 5, newSViv (ev.button.state), 0); |
502 | hv_store (hv, "state", 5, newSViv (ev.button.state), 0); |
503 | hv_store (hv, "x", 1, newSViv (ev.button.x), 0); |
503 | hv_store (hv, "x", 1, newSViv (ev.button.x), 0); |
504 | hv_store (hv, "y", 1, newSViv (ev.button.y), 0); |
504 | hv_store (hv, "y", 1, newSViv (ev.button.y), 0); |
505 | break; |
505 | break; |
|
|
506 | |
|
|
507 | case SDL_USEREVENT: |
|
|
508 | hv_store (hv, "code", 4, newSViv (ev.user.code), 0); |
|
|
509 | hv_store (hv, "data1", 5, newSViv ((IV)ev.user.data1), 0); |
|
|
510 | hv_store (hv, "data2", 5, newSViv ((IV)ev.user.data2), 0); |
|
|
511 | break; |
506 | } |
512 | } |
507 | |
513 | |
508 | XPUSHs (sv_2mortal (newRV_noinc ((SV *)hv))); |
514 | XPUSHs (sv_2mortal (newRV_noinc ((SV *)hv))); |
509 | } |
515 | } |
510 | } |
516 | } |
511 | |
517 | |
512 | int |
518 | int |
513 | Mix_OpenAudio (int frequency = 22050, int format = MIX_DEFAULT_FORMAT, int channels = 1, int chunksize = 512) |
519 | Mix_OpenAudio (int frequency = 48000, int format = MIX_DEFAULT_FORMAT, int channels = 1, int chunksize = 2048) |
514 | POSTCALL: |
520 | POSTCALL: |
515 | Mix_HookMusicFinished (music_finished); |
521 | Mix_HookMusicFinished (music_finished); |
516 | Mix_ChannelFinished (channel_finished); |
522 | Mix_ChannelFinished (channel_finished); |
517 | |
523 | |
518 | void |
524 | void |