3 // SDL Perl by David J. Goehrig <dgoehrig@cpan.org>
5 // Copyright (C) 2000,2001,2002,2003,2004 David J. Goehrig
7 // This software is under the GNU Library General Public License (LGPL)
8 // see the file COPYING for terms of use
21 #include <SDL_image.h>
25 #include <SDL_mixer.h>
26 void (*mix_music_finished_cv)();
45 #define TEXT_BLENDED 4
47 #define UTF8_SHADED 16
48 #define UTF8_BLENDED 32
49 #define UNICODE_SOLID 64
50 #define UNICODE_SHADED 128
51 #define UNICODE_BLENDED 256
55 #include <smpeg/smpeg.h>
57 static int sdl_perl_use_smpeg_audio = 0;
62 #include <SDL_rotozoom.h>
63 #include <SDL_gfxPrimitives.h>
64 #include <SDL_framerate.h>
65 #include <SDL_imageFilter.h>
69 #define HAVE_TLS_CONTEXT
75 #include <CoreServices/CoreServices.h>
76 void CPSEnableForegroundOperation(ProcessSerialNumber* psn);
77 void NSApplicationLoad();
78 void SDL_macosx_init(void) {
80 ProcessSerialNumber myProc, frProc;
81 if (GetFrontProcess(&frProc) == noErr)
82 if (GetCurrentProcess(&myProc) == noErr)
83 if (SameProcess(&frProc, &myProc, &sameProc) == noErr && sameProc == 0) {
85 NSLog(@"creating bad autorelease pool");
86 [[NSAutoreleasePool alloc] init];
89 CPSEnableForegroundOperation(&myProc);
92 void SDL_macosx_quit(void) {
101 sdl_perl_timer_callback ( Uint32 interval, void* param )
114 XPUSHs(sv_2mortal(newSViv(interval)));
117 if (0 != (back = call_sv(cmd,G_SCALAR))) {
119 if (back != 1 ) Perl_croak (aTHX_ "Timer Callback failed!");
122 Perl_croak(aTHX_ "Timer Callback failed!");
134 sdl_perl_audio_callback ( void* data, Uint8 *stream, int len )
145 XPUSHs(sv_2mortal(newSViv(PTR2IV(stream))));
146 XPUSHs(sv_2mortal(newSViv(len)));
149 call_sv(cmd,G_VOID|G_DISCARD);
158 #ifdef HAVE_SDL_MIXER
161 sdl_perl_music_callback ( void )
167 cmd = (SV*)Mix_GetMusicHookData();
174 call_sv(cmd,G_VOID|G_DISCARD);
184 sdl_perl_music_finished_callback ( void )
190 cmd = (SV*)mix_music_finished_cv;
191 if ( cmd == NULL ) return;
198 call_sv(cmd,G_VOID|G_DISCARD);
210 sdl_perl_atexit (void)
219 void boot_SDL__OpenGL();
227 MODULE = SDL_perl PACKAGE = SDL
233 RETVAL = SDL_GetError();
244 RETVAL = SDL_Init(flags);
245 #ifdef HAVE_TLS_CONTEXT
246 Perl_call_atexit(PERL_GET_CONTEXT, (void*)sdl_perl_atexit,0);
248 atexit(sdl_perl_atexit);
254 InitSubSystem ( flags )
257 RETVAL = SDL_InitSubSystem(flags);
262 QuitSubSystem ( flags )
265 SDL_QuitSubSystem(flags);
280 RETVAL = SDL_WasInit(flags);
293 RETVAL = SDL_GetTicks();
298 SetTimer ( interval, callback )
300 SDL_TimerCallback callback
302 RETVAL = SDL_SetTimer(interval,callback);
307 AddTimer ( interval, callback, param )
309 SDL_NewTimerCallback callback
312 RETVAL = SDL_AddTimer(interval,callback,param);
319 RETVAL = sdl_perl_timer_callback;
324 NewTimer ( interval, cmd )
328 RETVAL = SDL_AddTimer(interval,sdl_perl_timer_callback,cmd);
336 RETVAL = SDL_RemoveTimer(id);
343 RETVAL = SDL_CDNumDrives();
351 RETVAL = strdup(SDL_CDName(drive));
359 RETVAL = SDL_CDOpen(drive);
372 CDTrackType ( track )
375 RETVAL = track->type;
380 CDTrackLength ( track )
383 RETVAL = track->length;
388 CDTrackOffset ( track )
391 RETVAL = track->offset;
399 RETVAL = SDL_CDStatus(cd);
404 CDPlayTracks ( cd, start_track, ntracks, start_frame, nframes )
411 RETVAL = SDL_CDPlayTracks(cd,start_track,start_frame,ntracks,nframes);
416 CDPlay ( cd, start, length )
421 RETVAL = SDL_CDPlay(cd,start,length);
429 RETVAL = SDL_CDPause(cd);
437 RETVAL = SDL_CDResume(cd);
445 RETVAL = SDL_CDStop(cd);
453 RETVAL = SDL_CDEject(cd);
475 RETVAL = cd->numtracks;
483 RETVAL = cd->cur_track;
491 RETVAL = cd->cur_frame;
496 CDTrack ( cd, number )
500 RETVAL = (SDL_CDtrack *)(cd->track + number);
513 RETVAL = SDL_PushEvent( e );
520 RETVAL = (SDL_Event *) safemalloc (sizeof(SDL_Event));
534 RETVAL = SDL_PollEvent(e);
542 RETVAL = SDL_WaitEvent(e);
547 EventState ( type, state )
551 RETVAL = SDL_EventState(type,state);
564 SetEventType ( e, type )
574 ActiveEventGain ( e )
577 RETVAL = e->active.gain;
582 ActiveEventState ( e )
585 RETVAL = e->active.state;
593 RETVAL = e->key.state;
601 RETVAL = e->key.keysym.sym;
609 RETVAL = e->key.keysym.mod;
614 KeyEventUnicode ( e )
617 RETVAL = e->key.keysym.unicode;
622 KeyEventScanCode ( e )
625 RETVAL = e->key.keysym.scancode;
630 MouseMotionState ( e )
633 RETVAL = e->motion.state;
641 RETVAL = e->motion.x;
649 RETVAL = e->motion.y;
657 RETVAL = e->motion.xrel;
662 MouseMotionYrel ( e )
665 RETVAL = e->motion.yrel;
670 MouseButtonState ( e )
673 RETVAL = e->button.state;
681 RETVAL = e->button.button;
689 RETVAL = e->button.x;
697 RETVAL = e->button.y;
705 RETVAL = e->syswm.msg;
710 EnableUnicode ( enable )
713 RETVAL = SDL_EnableUNICODE(enable);
718 EnableKeyRepeat ( delay, interval )
722 SDL_EnableKeyRepeat(delay,interval);
727 RETVAL = SDL_GetModState();
732 SetModState ( state )
735 SDL_SetModState(state);
741 RETVAL = SDL_GetKeyName(sym);
746 CreateRGBSurface (flags, width, height, depth, Rmask, Gmask, Bmask, Amask )
756 RETVAL = SDL_CreateRGBSurface ( flags, width, height,
757 depth, Rmask, Gmask, Bmask, Amask );
763 CreateRGBSurfaceFrom (pixels, width, height, depth, pitch, Rmask, Gmask, Bmask, Amask )
775 Uint32 len = pitch * height;
776 New(0,pixeldata,len,Uint8);
777 Copy(pixels,pixeldata,len,Uint8);
778 RETVAL = SDL_CreateRGBSurfaceFrom ( pixeldata, width, height,
779 depth, pitch, Rmask, Gmask, Bmask, Amask );
783 #ifdef HAVE_SDL_IMAGE
789 RETVAL = IMG_Load(fname);
796 SurfaceCopy ( surface )
800 Uint32 size = surface->pitch * surface->h;
801 New(0,pixels,size,Uint8);
802 Copy(surface->pixels,pixels,size,Uint8);
803 RETVAL = SDL_CreateRGBSurfaceFrom(pixels,surface->w,surface->h,
804 surface->format->BitsPerPixel, surface->pitch,
805 surface->format->Rmask, surface->format->Gmask,
806 surface->format->Bmask, surface->format->Amask);
811 FreeSurface ( surface )
815 Uint8* pixels = surface->pixels;
816 Uint32 flags = surface->flags;
817 SDL_FreeSurface(surface);
818 if (flags & SDL_PREALLOC)
823 SurfaceFlags ( surface )
826 RETVAL = surface->flags;
831 SurfacePalette ( surface )
834 RETVAL = surface->format->palette;
839 SurfaceBitsPerPixel ( surface )
842 RETVAL = surface->format->BitsPerPixel;
847 SurfaceBytesPerPixel ( surface )
850 RETVAL = surface->format->BytesPerPixel;
855 SurfaceRshift ( surface )
858 RETVAL = surface->format->Rshift;
863 SurfaceGshift ( surface )
866 RETVAL = surface->format->Gshift;
871 SurfaceBshift ( surface )
874 RETVAL = surface->format->Bshift;
879 SurfaceAshift ( surface )
882 RETVAL = surface->format->Ashift;
887 SurfaceRmask( surface )
890 RETVAL = surface->format->Rmask;
895 SurfaceGmask ( surface )
898 RETVAL = surface->format->Gmask;
903 SurfaceBmask ( surface )
906 RETVAL = surface->format->Bmask;
911 SurfaceAmask ( surface )
914 RETVAL = surface->format->Amask;
919 SurfaceColorKey ( surface )
922 RETVAL = surface->format->colorkey;
927 SurfaceAlpha( surface )
930 RETVAL = surface->format->alpha;
951 SurfacePitch ( surface )
954 RETVAL = surface->pitch;
959 SurfacePixels ( surface )
962 RETVAL = newSVpvn(surface->pixels,surface->pitch*surface->h);
967 SurfacePixel ( surface, x, y, ... )
975 int bpp = surface->format->BytesPerPixel;
976 Uint8* p = (Uint8*)surface->pixels + bpp*x + surface->pitch*y;
977 if ( items < 3 || items > 4 )
978 Perl_croak(aTHX_ "usage: SDL::SurfacePixel(surface,x,y,[color])");
980 color = (SDL_Color*)SvIV(ST(3));
981 pix = SDL_MapRGB(surface->format,color->r,color->g,color->b);
990 if (SDL_BYTEORDER == SDL_BIG_ENDIAN) {
991 p[0] = (pix >> 16) & 0xff;
992 p[1] = (pix >> 8) & 0xff;
996 p[1] = (pix >> 8) & 0xff;
997 p[2] = (pix >> 16) & 0xff;
1005 RETVAL = (SDL_Color *) safemalloc(sizeof(SDL_Color));
1009 memcpy(RETVAL,&surface->format->palette[index],sizeof(SDL_Color));
1013 SDL_GetRGB(pix,surface->format,&r,&g,&b);
1021 SDL_GetRGB(pix,surface->format,&r,&g,&b);
1031 MUSTLOCK ( surface )
1032 SDL_Surface *surface
1034 RETVAL = SDL_MUSTLOCK(surface);
1039 SurfaceLock ( surface )
1040 SDL_Surface *surface
1042 RETVAL = SDL_LockSurface(surface);
1047 SurfaceUnlock ( surface )
1048 SDL_Surface *surface
1050 SDL_UnlockSurface(surface);
1055 RETVAL = SDL_GetVideoSurface();
1064 SDL_VideoInfo *info;
1065 info = (SDL_VideoInfo *) safemalloc ( sizeof(SDL_VideoInfo));
1066 memcpy(info,SDL_GetVideoInfo(),sizeof(SDL_VideoInfo));
1068 hv_store(hv,"hw_available",strlen("hw_available"),
1069 newSViv(info->hw_available),0);
1070 hv_store(hv,"wm_available",strlen("wm_available"),
1071 newSViv(info->wm_available),0);
1072 hv_store(hv,"blit_hw",strlen("blit_hw"),
1073 newSViv(info->blit_hw),0);
1074 hv_store(hv,"blit_hw_CC",strlen("blit_hw_CC"),
1075 newSViv(info->blit_hw_CC),0);
1076 hv_store(hv,"blit_hw_A",strlen("blit_hw_A"),
1077 newSViv(info->blit_hw_A),0);
1078 hv_store(hv,"blit_sw",strlen("blit_sw"),
1079 newSViv(info->blit_sw),0);
1080 hv_store(hv,"blit_sw_CC",strlen("blit_sw_CC"),
1081 newSViv(info->blit_sw_CC),0);
1082 hv_store(hv,"blit_sw_A",strlen("blit_sw_A"),
1083 newSViv(info->blit_sw_A),0);
1084 hv_store(hv,"blit_fill",strlen("blit_fill"),
1085 newSViv(info->blit_fill),0);
1086 hv_store(hv,"video_mem",strlen("video_mem"),
1087 newSViv(info->video_mem),0);
1093 NewRect ( x, y, w, h )
1099 RETVAL = (SDL_Rect *) safemalloc (sizeof(SDL_Rect));
1117 if (items > 1 ) rect->x = SvIV(ST(1));
1126 if (items > 1 ) rect->y = SvIV(ST(1));
1135 if (items > 1 ) rect->w = SvIV(ST(1));
1144 if (items > 1 ) rect->h = SvIV(ST(1));
1150 ListModes ( format, flags )
1152 SDL_PixelFormat *format
1156 mode = SDL_ListModes(format,flags);
1157 if (mode == (SDL_Rect**)-1 ) {
1158 av_push(RETVAL,newSVpv("all",0));
1159 } else if (! mode ) {
1160 av_push(RETVAL,newSVpv("none",0));
1162 for (;*mode;mode++) {
1163 av_push(RETVAL,newSViv(PTR2IV(*mode)));
1171 NewColor ( r, g, b )
1176 RETVAL = (SDL_Color *) safemalloc(sizeof(SDL_Color));
1184 ColorR ( color, ... )
1187 if (items > 1 ) color->r = SvIV(ST(1));
1193 ColorG ( color, ... )
1196 if (items > 1 ) color->g = SvIV(ST(1));
1202 ColorB ( color, ... )
1205 if (items > 1 ) color->b = SvIV(ST(1));
1211 ColorRGB ( color, ... )
1215 color->r = SvIV(ST(1));
1216 color->g = SvIV(ST(2));
1217 color->b = SvIV(ST(3));
1219 mXPUSHi( color->r );
1220 mXPUSHi( color->g );
1221 mXPUSHi( color->b );
1228 return; safefree(color);
1231 NewPalette ( number )
1234 RETVAL = (SDL_Palette *)safemalloc(sizeof(SDL_Palette));
1235 RETVAL->colors = (SDL_Color *)safemalloc(number *
1237 RETVAL->ncolors = number;
1242 PaletteNColors ( palette, ... )
1243 SDL_Palette *palette
1245 if ( items > 1 ) palette->ncolors = SvIV(ST(1));
1246 RETVAL = palette->ncolors;
1251 PaletteColors ( palette, index, ... )
1252 SDL_Palette *palette
1256 palette->colors[index].r = SvUV(ST(2));
1257 palette->colors[index].g = SvUV(ST(3));
1258 palette->colors[index].b = SvUV(ST(4));
1260 RETVAL = (SDL_Color *)(palette->colors + index);
1265 VideoModeOK ( width, height, bpp, flags )
1271 RETVAL = SDL_VideoModeOK(width,height,bpp,flags);
1276 SetVideoMode ( width, height, bpp, flags )
1282 RETVAL = SDL_SetVideoMode(width,height,bpp,flags);
1287 UpdateRect ( surface, x, y, w ,h )
1288 SDL_Surface *surface
1294 SDL_UpdateRect(surface,x,y,w,h);
1297 UpdateRects ( surface, ... )
1298 SDL_Surface *surface
1300 SDL_Rect *rects, *temp;
1302 if ( items < 2 ) return;
1303 num_rects = items - 1;
1304 rects = (SDL_Rect *)safemalloc(sizeof(SDL_Rect)*items);
1305 for(i=0;i<num_rects;i++) {
1306 temp = (SDL_Rect *)SvIV(ST(i+1));
1307 rects[i].x = temp->x;
1308 rects[i].y = temp->y;
1309 rects[i].w = temp->w;
1310 rects[i].h = temp->h;
1312 SDL_UpdateRects(surface,num_rects,rects);
1317 SDL_Surface *surface
1319 RETVAL = SDL_Flip(surface);
1324 SetColors ( surface, start, ... )
1325 SDL_Surface *surface
1328 SDL_Color *colors,*temp;
1330 if ( items < 3 ) { RETVAL = 0; goto all_done; }
1332 colors = (SDL_Color *)safemalloc(sizeof(SDL_Color)*(length+1));
1333 for ( i = 0; i < length ; i++ ) {
1334 temp = (SDL_Color *)SvIV(ST(i+2));
1335 colors[i].r = temp->r;
1336 colors[i].g = temp->g;
1337 colors[i].b = temp->b;
1339 RETVAL = SDL_SetColors(surface, colors, start, length );
1346 MapRGB ( surface, r, g, b )
1347 SDL_Surface *surface
1352 RETVAL = SDL_MapRGB(surface->format,r,g,b);
1357 MapRGBA ( surface, r, g, b, a )
1358 SDL_Surface *surface
1364 RETVAL = SDL_MapRGBA(surface->format,r,g,b,a);
1369 GetRGB ( surface, pixel )
1370 SDL_Surface *surface
1374 SDL_GetRGB(pixel,surface->format,&r,&g,&b);
1376 av_push(RETVAL,newSViv(r));
1377 av_push(RETVAL,newSViv(g));
1378 av_push(RETVAL,newSViv(b));
1383 GetRGBA ( surface, pixel )
1384 SDL_Surface *surface
1388 SDL_GetRGBA(pixel,surface->format,&r,&g,&b,&a);
1390 av_push(RETVAL,newSViv(r));
1391 av_push(RETVAL,newSViv(g));
1392 av_push(RETVAL,newSViv(b));
1393 av_push(RETVAL,newSViv(a));
1398 SaveBMP ( surface, filename )
1399 SDL_Surface *surface
1402 RETVAL = SDL_SaveBMP(surface,filename);
1407 SetColorKey ( surface, flag, key )
1408 SDL_Surface *surface
1412 Uint32 pixel = SDL_MapRGB(surface->format,key->r,key->g,key->b);
1413 RETVAL = SDL_SetColorKey(surface,flag,pixel);
1418 SetAlpha ( surface, flag, alpha )
1419 SDL_Surface *surface
1423 RETVAL = SDL_SetAlpha(surface,flag,alpha);
1428 DisplayFormat ( surface )
1429 SDL_Surface *surface
1431 RETVAL = SDL_DisplayFormat(surface);
1436 DisplayFormatAlpha ( surface )
1437 SDL_Surface *surface
1439 RETVAL = SDL_DisplayFormatAlpha(surface);
1444 ConvertRGB ( surface )
1445 SDL_Surface * surface
1447 SDL_PixelFormat fmt;
1449 fmt.BitsPerPixel = 24;
1450 fmt.BytesPerPixel = 3;
1451 fmt.Rmask = 0x000000ff;
1452 fmt.Gmask = 0x0000ff00;
1453 fmt.Bmask = 0x00ff0000;
1454 fmt.Amask = 0x00000000;
1465 RETVAL = SDL_ConvertSurface(surface,&fmt,surface->flags);
1470 ConvertRGBA ( surface )
1471 SDL_Surface * surface
1473 SDL_PixelFormat fmt;
1475 fmt.BitsPerPixel = 32;
1476 fmt.BytesPerPixel = 4;
1477 fmt.Rmask = 0x000000ff;
1478 fmt.Gmask = 0x0000ff00;
1479 fmt.Bmask = 0x00ff0000;
1480 fmt.Amask = 0xff000000;
1491 RETVAL = SDL_ConvertSurface(surface,&fmt,surface->flags);
1496 BlitSurface ( src, src_rect, dest, dest_rect )
1502 RETVAL = SDL_BlitSurface(src,src_rect,dest,dest_rect);
1507 FillRect ( dest, dest_rect, color )
1512 Uint32 pixel = SDL_MapRGB(dest->format,color->r,color->g,color->b);
1513 RETVAL = SDL_FillRect(dest,dest_rect,pixel);
1520 RETVAL = SDL_GetAppState();
1526 WMSetCaption ( title, icon )
1530 SDL_WM_SetCaption(title,icon);
1536 SDL_WM_GetCaption(&title,&icon);
1538 av_push(RETVAL,newSVpv(title,0));
1539 av_push(RETVAL,newSVpv(icon,0));
1547 SDL_WM_SetIcon(icon,NULL);
1562 mask = SDL_GetMouseState(&x,&y);
1564 av_push(RETVAL,newSViv(mask));
1565 av_push(RETVAL,newSViv(x));
1566 av_push(RETVAL,newSViv(y));
1571 GetRelativeMouseState ()
1576 mask = SDL_GetRelativeMouseState(&x,&y);
1578 av_push(RETVAL,newSViv(mask));
1579 av_push(RETVAL,newSViv(x));
1580 av_push(RETVAL,newSViv(y));
1585 NewCursor ( data, mask, x ,y )
1591 RETVAL = SDL_CreateCursor((Uint8*)data->pixels,
1592 (Uint8*)mask->pixels,data->w,data->h,x,y);
1597 FreeCursor ( cursor )
1600 SDL_FreeCursor(cursor);
1603 SetCursor ( cursor )
1606 SDL_SetCursor(cursor);
1611 RETVAL = SDL_GetCursor();
1616 ShowCursor ( toggle )
1619 RETVAL = SDL_ShowCursor(toggle);
1624 NewAudioSpec ( freq, format, channels, samples )
1630 RETVAL = (SDL_AudioSpec *)safemalloc(sizeof(SDL_AudioSpec));
1631 RETVAL->freq = freq;
1632 RETVAL->format = format;
1633 RETVAL->channels = channels;
1634 RETVAL->samples = samples;
1639 FreeAudioSpec ( spec )
1645 NewAudioCVT ( src_format, src_channels, src_rate, dst_format, dst_channels, dst_rate)
1653 RETVAL = (SDL_AudioCVT *)safemalloc(sizeof(SDL_AudioCVT));
1654 if (SDL_BuildAudioCVT(RETVAL,src_format, src_channels, src_rate,
1655 dst_format, dst_channels, dst_rate)) {
1656 safefree(RETVAL); RETVAL = NULL; }
1661 FreeAudioCVT ( cvt )
1667 ConvertAudioData ( cvt, data, len )
1673 cvt->buf = (Uint8*) safemalloc(cvt->len*cvt->len_mult);
1674 memcpy(cvt->buf,data,cvt->len);
1675 RETVAL = SDL_ConvertAudio(cvt);
1680 OpenAudio ( spec, callback )
1684 spec->userdata = (void*)callback;
1685 spec->callback = sdl_perl_audio_callback;
1686 RETVAL = SDL_OpenAudio(spec,NULL);
1693 RETVAL = SDL_GetAudioStatus ();
1701 SDL_PauseAudio(p_on);
1725 LoadWAV ( filename, spec )
1729 SDL_AudioSpec *temp;
1734 temp = SDL_LoadWAV(filename,spec,&buf,&len);
1735 if ( ! temp ) goto error;
1736 av_push(RETVAL,newSViv(PTR2IV(temp)));
1737 av_push(RETVAL,newSViv(PTR2IV(buf)));
1738 av_push(RETVAL,newSViv(len));
1743 #ifdef HAVE_SDL_MIXER
1746 MixAudio ( dst, src, len, volume )
1752 SDL_MixAudio(dst,src,len,volume);
1755 MixOpenAudio ( frequency, format, channels, chunksize )
1761 RETVAL = Mix_OpenAudio(frequency, format, channels, chunksize);
1766 MixAllocateChannels ( number )
1769 RETVAL = Mix_AllocateChannels(number);
1776 int freq, channels, status;
1778 status = Mix_QuerySpec(&freq,&format,&channels);
1780 av_push(RETVAL,newSViv(status));
1781 av_push(RETVAL,newSViv(freq));
1782 av_push(RETVAL,newSViv(format));
1783 av_push(RETVAL,newSViv(channels));
1788 MixLoadWAV ( filename )
1791 RETVAL = Mix_LoadWAV(filename);
1796 MixLoadMusic ( filename )
1799 RETVAL = Mix_LoadMUS(filename);
1804 MixQuickLoadWAV ( buf )
1807 RETVAL = Mix_QuickLoad_WAV(buf);
1812 MixFreeChunk( chunk )
1815 Mix_FreeChunk(chunk);
1818 MixFreeMusic ( music )
1821 Mix_FreeMusic(music);
1824 MixSetPostMixCallback ( func, arg )
1828 Mix_SetPostMix(func,arg);
1833 RETVAL = sdl_perl_music_callback;
1838 MixSetMusicHook ( func, arg )
1842 Mix_HookMusic(func,arg);
1845 MixSetMusicFinishedHook ( func )
1848 mix_music_finished_cv = func;
1849 Mix_HookMusicFinished(sdl_perl_music_finished_callback);
1852 MixGetMusicHookData ()
1854 RETVAL = Mix_GetMusicHookData();
1859 MixReverseChannels ( number )
1862 RETVAL = Mix_ReserveChannels ( number );
1867 MixGroupChannel ( which, tag )
1871 RETVAL = Mix_GroupChannel(which,tag);
1876 MixGroupChannels ( from, to, tag )
1881 RETVAL = Mix_GroupChannels(from,to,tag);
1886 MixGroupAvailable ( tag )
1889 RETVAL = Mix_GroupAvailable(tag);
1894 MixGroupCount ( tag )
1897 RETVAL = Mix_GroupCount(tag);
1902 MixGroupOldest ( tag )
1905 RETVAL = Mix_GroupOldest(tag);
1910 MixGroupNewer ( tag )
1913 RETVAL = Mix_GroupNewer(tag);
1918 MixPlayChannel ( channel, chunk, loops )
1923 RETVAL = Mix_PlayChannel(channel,chunk,loops);
1928 MixPlayChannelTimed ( channel, chunk, loops, ticks )
1934 RETVAL = Mix_PlayChannelTimed(channel,chunk,loops,ticks);
1939 MixPlayMusic ( music, loops )
1943 RETVAL = Mix_PlayMusic(music,loops);
1948 MixFadeInChannel ( channel, chunk, loops, ms )
1954 RETVAL = Mix_FadeInChannel(channel,chunk,loops,ms);
1959 MixFadeInChannelTimed ( channel, chunk, loops, ms, ticks )
1966 RETVAL = Mix_FadeInChannelTimed(channel,chunk,loops,ms,ticks);
1971 MixFadeInMusic ( music, loops, ms )
1976 RETVAL = Mix_FadeInMusic(music,loops,ms);
1981 MixVolume ( channel, volume )
1985 RETVAL = Mix_Volume(channel,volume);
1990 MixVolumeChunk ( chunk, volume )
1994 RETVAL = Mix_VolumeChunk(chunk,volume);
1999 MixVolumeMusic ( volume )
2002 RETVAL = Mix_VolumeMusic(volume);
2007 MixHaltChannel ( channel )
2010 RETVAL = Mix_HaltChannel(channel);
2015 MixHaltGroup ( tag )
2018 RETVAL = Mix_HaltGroup(tag);
2025 RETVAL = Mix_HaltMusic();
2030 MixExpireChannel ( channel, ticks )
2034 RETVAL = Mix_ExpireChannel ( channel,ticks);
2039 MixFadeOutChannel ( which, ms )
2043 RETVAL = Mix_FadeOutChannel(which,ms);
2048 MixFadeOutGroup ( which, ms )
2052 RETVAL = Mix_FadeOutGroup(which,ms);
2057 MixFadeOutMusic ( ms )
2060 RETVAL = Mix_FadeOutMusic(ms);
2067 RETVAL = Mix_FadingMusic();
2072 MixFadingChannel( which )
2075 RETVAL = Mix_FadingChannel(which);
2080 MixPause ( channel )
2086 MixResume ( channel )
2089 Mix_Resume(channel);
2092 MixPaused ( channel )
2095 RETVAL = Mix_Paused(channel);
2117 RETVAL = Mix_PausedMusic();
2122 MixPlaying( channel )
2125 RETVAL = Mix_Playing(channel);
2132 RETVAL = Mix_PlayingMusic();
2145 GLLoadLibrary ( path )
2148 RETVAL = SDL_GL_LoadLibrary(path);
2153 GLGetProcAddress ( proc )
2156 RETVAL = SDL_GL_GetProcAddress(proc);
2161 GLSetAttribute ( attr, value )
2165 RETVAL = SDL_GL_SetAttribute(attr, value);
2170 GLGetAttribute ( attr )
2175 av_push(RETVAL,newSViv(SDL_GL_GetAttribute(attr, &value)));
2176 av_push(RETVAL,newSViv(value));
2183 SDL_GL_SwapBuffers ();
2189 RETVAL = (SDL_BYTEORDER == SDL_BIG_ENDIAN);
2196 RETVAL = SDL_NumJoysticks();
2201 JoystickName ( index )
2204 RETVAL = (char*)SDL_JoystickName(index);
2209 JoystickOpen ( index )
2212 RETVAL = SDL_JoystickOpen(index);
2217 JoystickOpened ( index )
2220 RETVAL = SDL_JoystickOpened(index);
2225 JoystickIndex ( joystick )
2226 SDL_Joystick *joystick
2228 RETVAL = SDL_JoystickIndex(joystick);
2233 JoystickNumAxes ( joystick )
2234 SDL_Joystick *joystick
2236 RETVAL = SDL_JoystickNumAxes(joystick);
2241 JoystickNumBalls ( joystick )
2242 SDL_Joystick *joystick
2244 RETVAL = SDL_JoystickNumBalls(joystick);
2249 JoystickNumHats ( joystick )
2250 SDL_Joystick *joystick
2252 RETVAL = SDL_JoystickNumHats(joystick);
2257 JoystickNumButtons ( joystick )
2258 SDL_Joystick *joystick
2260 RETVAL = SDL_JoystickNumButtons(joystick);
2267 SDL_JoystickUpdate();
2270 JoystickGetAxis ( joystick, axis )
2271 SDL_Joystick *joystick
2274 RETVAL = SDL_JoystickGetAxis(joystick,axis);
2279 JoystickGetHat ( joystick, hat )
2280 SDL_Joystick *joystick
2283 RETVAL = SDL_JoystickGetHat(joystick,hat);
2288 JoystickGetButton ( joystick, button)
2289 SDL_Joystick *joystick
2292 RETVAL = SDL_JoystickGetButton(joystick,button);
2297 JoystickGetBall ( joystick, ball )
2298 SDL_Joystick *joystick
2302 success = SDL_JoystickGetBall(joystick,ball,&dx,&dy);
2304 av_push(RETVAL,newSViv(success));
2305 av_push(RETVAL,newSViv(dx));
2306 av_push(RETVAL,newSViv(dy));
2311 JoystickClose ( joystick )
2312 SDL_Joystick *joystick
2314 SDL_JoystickClose(joystick);
2317 JoyAxisEventWhich ( e )
2320 RETVAL = e->jaxis.which;
2325 JoyAxisEventAxis ( e )
2328 RETVAL = e->jaxis.axis;
2333 JoyAxisEventValue ( e )
2336 RETVAL = e->jaxis.value;
2341 JoyButtonEventWhich ( e )
2344 RETVAL = e->jbutton.which;
2349 JoyButtonEventButton ( e )
2352 RETVAL = e->jbutton.button;
2357 JoyButtonEventState ( e )
2360 RETVAL = e->jbutton.state;
2365 JoyHatEventWhich ( e )
2368 RETVAL = e->jhat.which;
2373 JoyHatEventHat ( e )
2376 RETVAL = e->jhat.hat;
2381 JoyHatEventValue ( e )
2384 RETVAL = e->jhat.value;
2389 JoyBallEventWhich ( e )
2392 RETVAL = e->jball.which;
2397 JoyBallEventBall ( e )
2400 RETVAL = e->jball.ball;
2405 JoyBallEventXrel ( e )
2408 RETVAL = e->jball.xrel;
2413 JoyBallEventYrel ( e )
2416 RETVAL = e->jball.yrel;
2421 SetClipRect ( surface, rect )
2422 SDL_Surface *surface
2425 SDL_SetClipRect(surface,rect);
2428 GetClipRect ( surface )
2429 SDL_Surface *surface
2431 RETVAL = (SDL_Rect*) safemalloc(sizeof(SDL_Rect));
2432 SDL_GetClipRect(surface,RETVAL);
2442 RETVAL = SDLNet_Init();
2452 NetNewIPaddress ( host, port )
2456 RETVAL = (IPaddress*) safemalloc(sizeof(IPaddress));
2457 RETVAL->host = host;
2458 RETVAL->port = port;
2463 NetIPaddressHost ( ip )
2471 NetIPaddressPort ( ip )
2479 NetFreeIPaddress ( ip )
2485 NetResolveIP ( address )
2488 RETVAL = SDLNet_ResolveIP(address);
2493 NetResolveHost ( address, host, port )
2498 RETVAL = SDLNet_ResolveHost(address,host,port);
2506 RETVAL = SDLNet_TCP_Open(ip);
2511 NetTCPAccept ( server )
2514 RETVAL = SDLNet_TCP_Accept(server);
2519 NetTCPGetPeerAddress ( sock )
2522 RETVAL = SDLNet_TCP_GetPeerAddress(sock);
2527 NetTCPSend ( sock, data, len )
2532 RETVAL = SDLNet_TCP_Send(sock,data,len);
2537 NetTCPRecv ( sock, maxlen )
2543 buffer = safemalloc(maxlen);
2545 status = SDLNet_TCP_Recv(sock,buffer,maxlen);
2546 av_push(RETVAL,newSViv(status));
2547 av_push(RETVAL,newSVpvn((char*)buffer,maxlen));
2552 NetTCPClose ( sock )
2555 SDLNet_TCP_Close(sock);
2558 NetAllocPacket ( size )
2561 RETVAL = SDLNet_AllocPacket(size);
2566 NetAllocPacketV ( howmany, size )
2570 RETVAL = SDLNet_AllocPacketV(howmany,size);
2575 NetResizePacket ( packet, newsize )
2579 RETVAL = SDLNet_ResizePacket(packet,newsize);
2584 NetFreePacket ( packet )
2587 SDLNet_FreePacket(packet);
2590 NetFreePacketV ( packet )
2593 SDLNet_FreePacketV(packet);
2599 RETVAL = SDLNet_UDP_Open(port);
2604 NetUDPBind ( sock, channel, address )
2609 RETVAL = SDLNet_UDP_Bind(sock,channel,address);
2614 NetUDPUnbind ( sock, channel )
2618 SDLNet_UDP_Unbind(sock,channel);
2621 NetUDPGetPeerAddress ( sock, channel )
2625 RETVAL = SDLNet_UDP_GetPeerAddress(sock,channel);
2630 NetUDPSendV ( sock, packets, npackets )
2635 RETVAL = SDLNet_UDP_SendV(sock,packets,npackets);
2640 NetUDPSend ( sock, channel, packet )
2645 RETVAL = SDLNet_UDP_Send(sock,channel,packet);
2650 NetUDPRecvV ( sock, packets )
2654 RETVAL = SDLNet_UDP_RecvV(sock,packets);
2659 NetUDPRecv ( sock, packet )
2663 RETVAL = SDLNet_UDP_Recv(sock,packet);
2668 NetUDPClose ( sock )
2671 SDLNet_UDP_Close(sock);
2674 NetAllocSocketSet ( maxsockets )
2677 RETVAL = SDLNet_AllocSocketSet(maxsockets);
2682 NetTCP_AddSocket ( set, sock )
2683 SDLNet_SocketSet set
2686 RETVAL = SDLNet_TCP_AddSocket(set,sock);
2691 NetUDP_AddSocket ( set, sock )
2692 SDLNet_SocketSet set
2695 RETVAL = SDLNet_UDP_AddSocket(set,sock);
2700 NetTCP_DelSocket ( set, sock )
2701 SDLNet_SocketSet set
2704 RETVAL = SDLNet_TCP_DelSocket(set,sock);
2709 NetUDP_DelSocket ( set, sock )
2710 SDLNet_SocketSet set
2713 RETVAL = SDLNet_UDP_DelSocket(set,sock);
2718 NetCheckSockets ( set, timeout )
2719 SDLNet_SocketSet set
2722 RETVAL = SDLNet_CheckSockets(set,timeout);
2727 NetSocketReady ( sock )
2728 SDLNet_GenericSocket sock
2730 RETVAL = SDLNet_SocketReady(sock);
2735 NetFreeSocketSet ( set )
2736 SDLNet_SocketSet set
2738 SDLNet_FreeSocketSet(set);
2741 NetWrite16 ( value, area )
2745 SDLNet_Write16(value,area);
2748 NetWrite32 ( value, area )
2752 SDLNet_Write32(value,area);
2758 RETVAL = SDLNet_Read16(area);
2766 RETVAL = SDLNet_Read32(area);
2777 RETVAL = TTF_Init();
2787 TTFOpenFont ( file, ptsize )
2791 RETVAL = TTF_OpenFont(file,ptsize);
2796 TTFGetFontStyle ( font )
2799 RETVAL = TTF_GetFontStyle(font);
2804 TTFSetFontStyle ( font, style )
2808 TTF_SetFontStyle(font,style);
2811 TTFFontHeight ( font )
2814 RETVAL = TTF_FontHeight(font);
2819 TTFFontAscent ( font )
2822 RETVAL = TTF_FontAscent(font);
2827 TTFFontDescent ( font )
2830 RETVAL = TTF_FontDescent(font);
2835 TTFFontLineSkip ( font )
2838 RETVAL = TTF_FontLineSkip(font);
2843 TTFGlyphMetrics ( font, ch )
2847 int minx, miny, maxx, maxy, advance;
2849 TTF_GlyphMetrics(font, ch, &minx, &miny, &maxx, &maxy, &advance);
2850 av_push(RETVAL,newSViv(minx));
2851 av_push(RETVAL,newSViv(miny));
2852 av_push(RETVAL,newSViv(maxx));
2853 av_push(RETVAL,newSViv(maxy));
2854 av_push(RETVAL,newSViv(advance));
2859 TTFSizeText ( font, text )
2865 TTF_SizeText(font,text,&w,&h);
2866 av_push(RETVAL,newSViv(w));
2867 av_push(RETVAL,newSViv(h));
2872 TTFSizeUTF8 ( font, text )
2878 TTF_SizeUTF8(font,text,&w,&h);
2879 av_push(RETVAL,newSViv(w));
2880 av_push(RETVAL,newSViv(h));
2885 TTFSizeUNICODE ( font, text )
2891 TTF_SizeUNICODE(font,text,&w,&h);
2892 av_push(RETVAL,newSViv(w));
2893 av_push(RETVAL,newSViv(h));
2898 TTFRenderTextSolid ( font, text, fg )
2903 RETVAL = TTF_RenderText_Solid(font,text,*fg);
2908 TTFRenderUTF8Solid ( font, text, fg )
2913 RETVAL = TTF_RenderUTF8_Solid(font,text,*fg);
2918 TTFRenderUNICODESolid ( font, text, fg )
2923 RETVAL = TTF_RenderUNICODE_Solid(font,text,*fg);
2928 TTFRenderGlyphSolid ( font, ch, fg )
2933 RETVAL = TTF_RenderGlyph_Solid(font,ch,*fg);
2938 TTFRenderTextShaded ( font, text, fg, bg )
2944 RETVAL = TTF_RenderText_Shaded(font,text,*fg,*bg);
2949 TTFRenderUTF8Shaded( font, text, fg, bg )
2955 RETVAL = TTF_RenderUTF8_Shaded(font,text,*fg,*bg);
2960 TTFRenderUNICODEShaded( font, text, fg, bg )
2966 RETVAL = TTF_RenderUNICODE_Shaded(font,text,*fg,*bg);
2971 TTFRenderGlyphShaded ( font, ch, fg, bg )
2977 RETVAL = TTF_RenderGlyph_Shaded(font,ch,*fg,*bg);
2982 TTFRenderTextBlended( font, text, fg )
2987 RETVAL = TTF_RenderText_Blended(font,text,*fg);
2992 TTFRenderUTF8Blended( font, text, fg )
2997 RETVAL = TTF_RenderUTF8_Blended(font,text,*fg);
3002 TTFRenderUNICODEBlended( font, text, fg )
3007 RETVAL = TTF_RenderUNICODE_Blended(font,text,*fg);
3012 TTFRenderGlyphBlended( font, ch, fg )
3017 RETVAL = TTF_RenderGlyph_Blended(font,ch,*fg);
3022 TTFCloseFont ( font )
3025 TTF_CloseFont(font);
3028 TTFPutString ( font, mode, surface, x, y, fg, bg, text )
3031 SDL_Surface *surface
3046 img = TTF_RenderText_Solid(font,text,*fg);
3047 TTF_SizeText(font,text,&w,&h);
3052 img = TTF_RenderText_Shaded(font,text,*fg,*bg);
3053 TTF_SizeText(font,text,&w,&h);
3058 img = TTF_RenderText_Blended(font,text,*fg);
3059 TTF_SizeText(font,text,&w,&h);
3064 img = TTF_RenderUTF8_Solid(font,text,*fg);
3065 TTF_SizeUTF8(font,text,&w,&h);
3070 img = TTF_RenderUTF8_Shaded(font,text,*fg,*bg);
3071 TTF_SizeUTF8(font,text,&w,&h);
3076 img = TTF_RenderUTF8_Blended(font,text,*fg);
3077 TTF_SizeUTF8(font,text,&w,&h);
3082 img = TTF_RenderUNICODE_Solid(font,(Uint16*)text,*fg);
3083 TTF_SizeUNICODE(font,(Uint16*)text,&w,&h);
3087 case UNICODE_SHADED:
3088 img = TTF_RenderUNICODE_Shaded(font,(Uint16*)text,*fg,*bg);
3089 TTF_SizeUNICODE(font,(Uint16*)text,&w,&h);
3093 case UNICODE_BLENDED:
3094 img = TTF_RenderUNICODE_Blended(font,(Uint16*)text,*fg);
3095 TTF_SizeUNICODE(font,(Uint16*)text,&w,&h);
3100 img = TTF_RenderText_Shaded(font,text,*fg,*bg);
3101 TTF_SizeText(font,text,&w,&h);
3105 if ( img && img->format && img->format->palette ) {
3106 SDL_Color *c = &img->format->palette->colors[0];
3107 Uint32 key = SDL_MapRGB( img->format, c->r, c->g, c->b );
3108 SDL_SetColorKey(img,SDL_SRCCOLORKEY,key );
3109 if (0 > SDL_BlitSurface(img,NULL,surface,&dest)) {
3110 SDL_FreeSurface(img);
3122 CreateYUVOverlay ( width, height, format, display )
3126 SDL_Surface *display
3128 RETVAL = SDL_CreateYUVOverlay ( width, height, format, display );
3133 LockYUVOverlay ( overlay )
3134 SDL_Overlay *overlay
3136 RETVAL = SDL_LockYUVOverlay(overlay);
3141 UnlockYUVOverlay ( overlay )
3142 SDL_Overlay *overlay
3144 SDL_UnlockYUVOverlay(overlay);
3147 DisplayYUVOverlay ( overlay, dstrect )
3148 SDL_Overlay *overlay
3151 RETVAL = SDL_DisplayYUVOverlay ( overlay, dstrect );
3156 FreeYUVOverlay ( overlay )
3157 SDL_Overlay *overlay
3159 SDL_FreeYUVOverlay ( overlay );
3162 OverlayFormat ( overlay, ... )
3163 SDL_Overlay *overlay
3166 overlay->format = SvIV(ST(1));
3167 RETVAL = overlay->format;
3172 OverlayW ( overlay, ... )
3173 SDL_Overlay *overlay
3176 overlay->w = SvIV(ST(1));
3177 RETVAL = overlay->w;
3182 OverlayH ( overlay, ... )
3183 SDL_Overlay *overlay
3186 overlay->h = SvIV(ST(1));
3187 RETVAL = overlay->h;
3192 OverlayPlanes ( overlay, ... )
3193 SDL_Overlay *overlay
3196 overlay->planes = SvIV(ST(1));
3197 RETVAL = overlay->planes;
3202 OverlayHW ( overlay )
3203 SDL_Overlay *overlay
3205 RETVAL = overlay->hw_overlay;
3210 OverlayPitches ( overlay )
3211 SDL_Overlay *overlay
3213 RETVAL = overlay->pitches;
3218 OverlayPixels ( overlay )
3219 SDL_Overlay *overlay
3221 RETVAL = overlay->pixels;
3226 WMToggleFullScreen ( surface )
3227 SDL_Surface *surface
3229 RETVAL = SDL_WM_ToggleFullScreen(surface);
3234 WMGrabInput ( mode )
3237 RETVAL = SDL_WM_GrabInput(mode);
3244 RETVAL = SDL_WM_IconifyWindow();
3252 RETVAL = e->resize.w;
3260 RETVAL = e->resize.h;
3268 RETVAL = SDL_AudioDriverName(name,32);
3276 if (k >= SDLK_LAST) Perl_croak (aTHX_ "Key out of range");
3277 RETVAL = SDL_GetKeyState(NULL)[k];
3286 RETVAL = (SMPEG_Info *) safemalloc (sizeof(SMPEG_Info));
3291 FreeSMPEGInfo ( info )
3297 SMPEGInfoHasAudio ( info )
3300 RETVAL = info->has_audio;
3305 SMPEGInfoHasVideo ( info )
3308 RETVAL = info->has_video;
3313 SMPEGInfoWidth ( info )
3316 RETVAL = info->width;
3321 SMPEGInfoHeight ( info )
3324 RETVAL = info->height;
3329 SMPEGInfoCurrentFrame ( info )
3332 RETVAL = info->current_frame;
3337 SMPEGInfoCurrentFPS ( info )
3340 RETVAL = info->current_fps;
3345 SMPEGInfoCurrentAudioFrame ( info )
3348 RETVAL = info->audio_current_frame;
3353 SMPEGInfoCurrentOffset ( info )
3356 RETVAL = info->current_offset;
3361 SMPEGInfoTotalSize ( info )
3364 RETVAL = info->total_size;
3369 SMPEGInfoCurrentTime ( info )
3372 RETVAL = info->current_time;
3377 SMPEGInfoTotalTime ( info )
3380 RETVAL = info->total_time;
3388 RETVAL = SMPEG_error(mpeg);
3393 NewSMPEG ( filename, info, use_audio )
3398 #ifdef HAVE_SDL_MIXER
3399 RETVAL = SMPEG_new(filename,info,0);
3401 RETVAL = SMPEG_new(filename,info,use_audio);
3413 SMPEGEnableAudio ( mpeg , flag )
3417 SMPEG_enableaudio(mpeg,flag);
3418 #ifdef HAVE_SDL_MIXER
3419 sdl_perl_use_smpeg_audio = flag;
3423 SMPEGEnableVideo ( mpeg , flag )
3427 SMPEG_enablevideo(mpeg,flag);
3430 SMPEGSetVolume ( mpeg , volume )
3434 SMPEG_setvolume(mpeg,volume);
3437 SMPEGSetDisplay ( mpeg, dest, surfLock )
3440 SDL_mutex* surfLock;
3442 SMPEG_setdisplay(mpeg,dest,surfLock,NULL);
3445 SMPEGScaleXY ( mpeg, w, h)
3450 SMPEG_scaleXY(mpeg,w,h);
3453 SMPEGScale ( mpeg, scale )
3457 SMPEG_scale(mpeg,scale);
3463 SDL_AudioSpec audiofmt;
3466 #ifdef HAVE_SDL_MIXER
3467 if (sdl_perl_use_smpeg_audio ) {
3468 SMPEG_enableaudio(mpeg, 0);
3469 Mix_QuerySpec(&freq, &format, &channels);
3470 audiofmt.format = format;
3471 audiofmt.freq = freq;
3472 audiofmt.channels = channels;
3473 SMPEG_actualSpec(mpeg, &audiofmt);
3474 Mix_HookMusic(SMPEG_playAudioSDL, mpeg);
3475 SMPEG_enableaudio(mpeg, 1);
3481 SMPEGStatus ( mpeg )
3484 RETVAL = SMPEG_status(mpeg);
3495 SMPEGLoop ( mpeg, repeat )
3499 SMPEG_loop(mpeg,repeat);
3506 #ifdef HAVE_SDL_MIXER
3507 Mix_HookMusic(NULL, NULL);
3511 SMPEGRewind ( mpeg )
3517 SMPEGSeek ( mpeg, bytes )
3521 SMPEG_seek(mpeg,bytes);
3524 SMPEGSkip ( mpeg, seconds )
3528 SMPEG_skip(mpeg,seconds);
3531 SMPEGSetDisplayRegion ( mpeg, rect )
3535 SMPEG_setdisplayregion(mpeg,rect->x,rect->y,rect->w,rect->h);
3538 SMPEGRenderFrame ( mpeg, frame )
3542 SMPEG_renderFrame(mpeg,frame);
3545 SMPEGGetInfo ( mpeg )
3548 RETVAL = (SMPEG_Info *) safemalloc (sizeof(SMPEG_Info));
3549 SMPEG_getinfo(mpeg,RETVAL);
3559 GFXRotoZoom ( src, angle, zoom, smooth)
3565 RETVAL = rotozoomSurface( src, angle, zoom, smooth);
3570 GFXZoom ( src, zoomx, zoomy, smooth)
3576 RETVAL = zoomSurface( src, zoomx, zoomy, smooth);
3582 GFXPixelColor ( dst, x, y, color )
3588 RETVAL = pixelColor( dst, x, y, color);
3593 GFXPixelRGBA ( dst, x, y, r, g, b, a )
3602 RETVAL = pixelRGBA( dst, x, y, r, g, b, a );
3607 GFXHlineColor ( dst, x1, x2, y, color )
3614 RETVAL = hlineColor( dst, x1, x2, y, color );
3619 GFXHlineRGBA ( dst, x1, x2, y, r, g, b, a )
3629 RETVAL = hlineRGBA( dst, x1, x2, y, r, g, b, a );
3634 GFXVlineColor ( dst, x, y1, y2, color )
3641 RETVAL = vlineColor( dst, x, y1, y2, color );
3646 GFXVlineRGBA ( dst, x, y1, y2, r, g, b, a )
3656 RETVAL = vlineRGBA( dst, x, y1, y2, r, g, b, a );
3661 GFXRectangleColor ( dst, x1, y1, x2, y2, color )
3669 RETVAL = rectangleColor( dst, x1, y1, x2, y2, color );
3674 GFXRectangleRGBA ( dst, x1, y1, x2, y2, r, g, b, a )
3685 RETVAL = rectangleRGBA( dst, x1, y1, x2, y2, r, g, b, a );
3690 GFXBoxColor ( dst, x1, y1, x2, y2, color )
3698 RETVAL = boxColor( dst, x1, y1, x2, y2, color );
3703 GFXBoxRGBA ( dst, x1, y1, x2, y2, r, g, b, a )
3714 RETVAL = boxRGBA( dst, x1, y1, x2, y2, r, g, b, a );
3719 GFXLineColor ( dst, x1, y1, x2, y2, color )
3727 RETVAL = lineColor( dst, x1, y1, x2, y2, color );
3732 GFXLineRGBA ( dst, x1, y1, x2, y2, r, g, b, a )
3743 RETVAL = lineRGBA( dst, x1, y1, x2, y2, r, g, b, a );
3748 GFXAalineColor ( dst, x1, y1, x2, y2, color )
3756 RETVAL = aalineColor( dst, x1, y1, x2, y2, color );
3761 GFXAalineRGBA ( dst, x1, y1, x2, y2, r, g, b, a )
3772 RETVAL = aalineRGBA( dst, x1, y1, x2, y2, r, g, b, a );
3777 GFXCircleColor ( dst, x, y, r, color )
3784 RETVAL = circleColor( dst, x, y, r, color );
3789 GFXCircleRGBA ( dst, x, y, rad, r, g, b, a )
3799 RETVAL = circleRGBA( dst, x, y, rad, r, g, b, a );
3804 GFXAacircleColor ( dst, x, y, r, color )
3811 RETVAL = aacircleColor( dst, x, y, r, color );
3816 GFXAacircleRGBA ( dst, x, y, rad, r, g, b, a )
3826 RETVAL = aacircleRGBA( dst, x, y, rad, r, g, b, a );
3831 GFXFilledCircleColor ( dst, x, y, r, color )
3838 RETVAL = filledCircleColor( dst, x, y, r, color );
3843 GFXFilledCircleRGBA ( dst, x, y, rad, r, g, b, a )
3853 RETVAL = filledCircleRGBA( dst, x, y, rad, r, g, b, a );
3858 GFXEllipseColor ( dst, x, y, rx, ry, color )
3866 RETVAL = ellipseColor( dst, x, y, rx, ry, color );
3871 GFXEllipseRGBA ( dst, x, y, rx, ry, r, g, b, a )
3882 RETVAL = ellipseRGBA( dst, x, y, rx, ry, r, g, b, a );
3887 GFXAaellipseColor ( dst, xc, yc, rx, ry, color )
3895 RETVAL = aaellipseColor( dst, xc, yc, rx, ry, color );
3900 GFXAaellipseRGBA ( dst, x, y, rx, ry, r, g, b, a )
3911 RETVAL = aaellipseRGBA( dst, x, y, rx, ry, r, g, b, a );
3916 GFXFilledEllipseColor ( dst, x, y, rx, ry, color )
3924 RETVAL = filledEllipseColor( dst, x, y, rx, ry, color );
3929 GFXFilledEllipseRGBA ( dst, x, y, rx, ry, r, g, b, a )
3940 RETVAL = filledEllipseRGBA( dst, x, y, rx, ry, r, g, b, a );
3945 GFXFilledPieColor ( dst, x, y, rad, start, end, color )
3954 RETVAL = filledPieColor( dst, x, y, rad, start, end, color );
3959 GFXFilledPieRGBA ( dst, x, y, rad, start, end, r, g, b, a )
3971 RETVAL = filledPieRGBA( dst, x, y, rad, start, end, r, g, b, a );
3976 GFXPolygonColor ( dst, vx, vy, n, color )
3983 RETVAL = polygonColor( dst, vx, vy, n, color );
3988 GFXPolygonRGBA ( dst, vx, vy, n, r, g, b, a )
3998 RETVAL = polygonRGBA( dst, vx, vy, n, r, g, b, a );
4003 GFXAapolygonColor ( dst, vx, vy, n, color )
4010 RETVAL = aapolygonColor( dst, vx, vy, n, color );
4015 GFXAapolygonRGBA ( dst, vx, vy, n, r, g, b, a )
4025 RETVAL = aapolygonRGBA( dst, vx, vy, n, r, g, b, a );
4030 GFXFilledPolygonColor ( dst, vx, vy, n, color )
4037 RETVAL = filledPolygonColor( dst, vx, vy, n, color );
4042 GFXFilledPolygonRGBA ( dst, vx, vy, n, r, g, b, a )
4052 RETVAL = filledPolygonRGBA( dst, vx, vy, n, r, g, b, a );
4057 GFXCharacterColor ( dst, x, y, c, color )
4064 RETVAL = characterColor( dst, x, y, c, color );
4069 GFXCharacterRGBA ( dst, x, y, c, r, g, b, a )
4079 RETVAL = characterRGBA( dst, x, y, c, r, g, b, a );
4084 GFXStringColor ( dst, x, y, c, color )
4091 RETVAL = stringColor( dst, x, y, c, color );
4096 GFXStringRGBA ( dst, x, y, c, r, g, b, a )
4106 RETVAL = stringRGBA( dst, x, y, c, r, g, b, a );
4112 #ifdef HAVE_SDL_SOUND
4115 SoundAudioInfoFormat ( audioinfo )
4116 Sound_AudioInfo* audioinfo
4118 RETVAL = audioinfo->format;
4123 SoundAudioInfoChannels ( audioinfo )
4124 Sound_AudioInfo* audioinfo
4126 RETVAL = audioinfo->channels;
4131 SoundAudioInforate ( audioinfo )
4132 Sound_AudioInfo* audioinfo
4134 RETVAL = audioinfo->rate;
4139 SoundDecoderInfoExtensions ( decoderinfo )
4140 Sound_DecoderInfo* decoderinfo
4143 for ( ext = decoderinfo->extensions; *ext != NULL; ext++ ){
4144 av_push(RETVAL,sv_2mortal(newSVpv(*ext,0)));
4150 SoundDecoderInfoDescription ( decoderinfo )
4151 Sound_DecoderInfo* decoderinfo
4153 RETVAL = decoderinfo->description;
4158 SoundDecoderInfoAuthor ( decoderinfo )
4159 Sound_DecoderInfo* decoderinfo
4161 RETVAL = decoderinfo->author;
4166 SoundDecoderInfoUrl ( decoderinfo )
4167 Sound_DecoderInfo* decoderinfo
4169 RETVAL = decoderinfo->url;
4173 const Sound_DecoderInfo*
4174 SoundSampleDecoder ( sample )
4175 Sound_Sample* sample
4177 RETVAL = sample->decoder;
4182 SoundSampleDesired ( sample )
4183 Sound_Sample* sample
4185 RETVAL = &sample->desired;
4190 SoundSampleAcutal ( sample )
4191 Sound_Sample* sample
4193 RETVAL = &sample->actual;
4198 SoundSampleBuffer ( sample )
4199 Sound_Sample* sample
4201 RETVAL = sample->buffer;
4206 SoundSampleBufferSize ( sample )
4207 Sound_Sample* sample
4209 RETVAL = sample->buffer;
4214 SoundSampleFlags ( sample )
4215 Sound_Sample* sample
4217 RETVAL = (Uint32)sample->flags;
4225 MODULE = SDL PACKAGE = SDL
4226 PROTOTYPES : DISABLE