3 // SDL Perl by David J. Goehrig <dgoehrig@cpan.org>
5 // Copyright (C) 2000,2001,2002,2003,2004 David J. Goehrig
6 // Copyright (C) 2009 Kartik Thakore
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));
532 PeepEvents( e, numevents, action, mask)
535 SDL_eventaction action
538 RETVAL = (int)SDL_PeepEvents( e, numevents, action, mask);
547 RETVAL = SDL_PollEvent(e);
555 RETVAL = SDL_WaitEvent(e);
560 EventState ( type, state )
564 RETVAL = SDL_EventState(type,state);
577 SetEventType ( e, type )
587 ActiveEventGain ( e )
590 RETVAL = e->active.gain;
595 ActiveEventState ( e )
598 RETVAL = e->active.state;
606 RETVAL = e->key.state;
614 RETVAL = e->key.keysym.sym;
622 RETVAL = e->key.keysym.mod;
627 KeyEventUnicode ( e )
630 RETVAL = e->key.keysym.unicode;
635 KeyEventScanCode ( e )
638 RETVAL = e->key.keysym.scancode;
643 MouseMotionState ( e )
646 RETVAL = e->motion.state;
654 RETVAL = e->motion.x;
662 RETVAL = e->motion.y;
670 RETVAL = e->motion.xrel;
675 MouseMotionYrel ( e )
678 RETVAL = e->motion.yrel;
683 MouseButtonState ( e )
686 RETVAL = e->button.state;
694 RETVAL = e->button.button;
702 RETVAL = e->button.x;
710 RETVAL = e->button.y;
718 RETVAL = e->syswm.msg;
723 EnableUnicode ( enable )
726 RETVAL = SDL_EnableUNICODE(enable);
731 EnableKeyRepeat ( delay, interval )
735 SDL_EnableKeyRepeat(delay,interval);
740 RETVAL = SDL_GetModState();
745 SetModState ( state )
748 SDL_SetModState(state);
754 RETVAL = SDL_GetKeyName(sym);
759 CreateRGBSurface (flags, width, height, depth, Rmask, Gmask, Bmask, Amask )
769 RETVAL = SDL_CreateRGBSurface ( flags, width, height,
770 depth, Rmask, Gmask, Bmask, Amask );
776 CreateRGBSurfaceFrom (pixels, width, height, depth, pitch, Rmask, Gmask, Bmask, Amask )
788 Uint32 len = pitch * height;
789 New(0,pixeldata,len,Uint8);
790 Copy(pixels,pixeldata,len,Uint8);
791 RETVAL = SDL_CreateRGBSurfaceFrom ( pixeldata, width, height,
792 depth, pitch, Rmask, Gmask, Bmask, Amask );
796 #ifdef HAVE_SDL_IMAGE
802 RETVAL = IMG_Load(fname);
809 SurfaceCopy ( surface )
813 Uint32 size = surface->pitch * surface->h;
814 New(0,pixels,size,Uint8);
815 Copy(surface->pixels,pixels,size,Uint8);
816 RETVAL = SDL_CreateRGBSurfaceFrom(pixels,surface->w,surface->h,
817 surface->format->BitsPerPixel, surface->pitch,
818 surface->format->Rmask, surface->format->Gmask,
819 surface->format->Bmask, surface->format->Amask);
824 FreeSurface ( surface )
828 Uint8* pixels = surface->pixels;
829 Uint32 flags = surface->flags;
830 SDL_FreeSurface(surface);
831 if (flags & SDL_PREALLOC)
836 SurfaceFlags ( surface )
839 RETVAL = surface->flags;
844 SurfacePalette ( surface )
847 RETVAL = surface->format->palette;
852 SurfaceBitsPerPixel ( surface )
855 RETVAL = surface->format->BitsPerPixel;
860 SurfaceBytesPerPixel ( surface )
863 RETVAL = surface->format->BytesPerPixel;
868 SurfaceRshift ( surface )
871 RETVAL = surface->format->Rshift;
876 SurfaceGshift ( surface )
879 RETVAL = surface->format->Gshift;
884 SurfaceBshift ( surface )
887 RETVAL = surface->format->Bshift;
892 SurfaceAshift ( surface )
895 RETVAL = surface->format->Ashift;
900 SurfaceRmask( surface )
903 RETVAL = surface->format->Rmask;
908 SurfaceGmask ( surface )
911 RETVAL = surface->format->Gmask;
916 SurfaceBmask ( surface )
919 RETVAL = surface->format->Bmask;
924 SurfaceAmask ( surface )
927 RETVAL = surface->format->Amask;
932 SurfaceColorKey ( surface )
935 RETVAL = surface->format->colorkey;
940 SurfaceAlpha( surface )
943 RETVAL = surface->format->alpha;
964 SurfacePitch ( surface )
967 RETVAL = surface->pitch;
972 SurfacePixels ( surface )
975 RETVAL = newSVpvn(surface->pixels,surface->pitch*surface->h);
980 SurfacePixel ( surface, x, y, ... )
988 int bpp = surface->format->BytesPerPixel;
989 Uint8* p = (Uint8*)surface->pixels + bpp*x + surface->pitch*y;
990 if ( items < 3 || items > 4 )
991 Perl_croak(aTHX_ "usage: SDL::SurfacePixel(surface,x,y,[color])");
993 color = (SDL_Color*)SvIV(ST(3));
994 pix = SDL_MapRGB(surface->format,color->r,color->g,color->b);
1003 if (SDL_BYTEORDER == SDL_BIG_ENDIAN) {
1004 p[0] = (pix >> 16) & 0xff;
1005 p[1] = (pix >> 8) & 0xff;
1009 p[1] = (pix >> 8) & 0xff;
1010 p[2] = (pix >> 16) & 0xff;
1018 RETVAL = (SDL_Color *) safemalloc(sizeof(SDL_Color));
1022 memcpy(RETVAL,&surface->format->palette[index],sizeof(SDL_Color));
1026 SDL_GetRGB(pix,surface->format,&r,&g,&b);
1034 SDL_GetRGB(pix,surface->format,&r,&g,&b);
1044 MUSTLOCK ( surface )
1045 SDL_Surface *surface
1047 RETVAL = SDL_MUSTLOCK(surface);
1052 SurfaceLock ( surface )
1053 SDL_Surface *surface
1055 RETVAL = SDL_LockSurface(surface);
1060 SurfaceUnlock ( surface )
1061 SDL_Surface *surface
1063 SDL_UnlockSurface(surface);
1068 RETVAL = SDL_GetVideoSurface();
1077 SDL_VideoInfo *info;
1078 info = (SDL_VideoInfo *) safemalloc ( sizeof(SDL_VideoInfo));
1079 memcpy(info,SDL_GetVideoInfo(),sizeof(SDL_VideoInfo));
1081 hv_store(hv,"hw_available",strlen("hw_available"),
1082 newSViv(info->hw_available),0);
1083 hv_store(hv,"wm_available",strlen("wm_available"),
1084 newSViv(info->wm_available),0);
1085 hv_store(hv,"blit_hw",strlen("blit_hw"),
1086 newSViv(info->blit_hw),0);
1087 hv_store(hv,"blit_hw_CC",strlen("blit_hw_CC"),
1088 newSViv(info->blit_hw_CC),0);
1089 hv_store(hv,"blit_hw_A",strlen("blit_hw_A"),
1090 newSViv(info->blit_hw_A),0);
1091 hv_store(hv,"blit_sw",strlen("blit_sw"),
1092 newSViv(info->blit_sw),0);
1093 hv_store(hv,"blit_sw_CC",strlen("blit_sw_CC"),
1094 newSViv(info->blit_sw_CC),0);
1095 hv_store(hv,"blit_sw_A",strlen("blit_sw_A"),
1096 newSViv(info->blit_sw_A),0);
1097 hv_store(hv,"blit_fill",strlen("blit_fill"),
1098 newSViv(info->blit_fill),0);
1099 hv_store(hv,"video_mem",strlen("video_mem"),
1100 newSViv(info->video_mem),0);
1106 NewRect ( x, y, w, h )
1112 RETVAL = (SDL_Rect *) safemalloc (sizeof(SDL_Rect));
1130 if (items > 1 ) rect->x = SvIV(ST(1));
1139 if (items > 1 ) rect->y = SvIV(ST(1));
1148 if (items > 1 ) rect->w = SvIV(ST(1));
1157 if (items > 1 ) rect->h = SvIV(ST(1));
1163 ListModes ( format, flags )
1165 SDL_PixelFormat *format
1169 mode = SDL_ListModes(format,flags);
1170 if (mode == (SDL_Rect**)-1 ) {
1171 av_push(RETVAL,newSVpv("all",0));
1172 } else if (! mode ) {
1173 av_push(RETVAL,newSVpv("none",0));
1175 for (;*mode;mode++) {
1176 av_push(RETVAL,newSViv(PTR2IV(*mode)));
1184 NewColor ( r, g, b )
1189 RETVAL = (SDL_Color *) safemalloc(sizeof(SDL_Color));
1197 ColorR ( color, ... )
1200 if (items > 1 ) color->r = SvIV(ST(1));
1206 ColorG ( color, ... )
1209 if (items > 1 ) color->g = SvIV(ST(1));
1215 ColorB ( color, ... )
1218 if (items > 1 ) color->b = SvIV(ST(1));
1224 ColorRGB ( color, ... )
1228 color->r = SvIV(ST(1));
1229 color->g = SvIV(ST(2));
1230 color->b = SvIV(ST(3));
1232 mXPUSHi( color->r );
1233 mXPUSHi( color->g );
1234 mXPUSHi( color->b );
1241 return; safefree(color);
1244 NewPalette ( number )
1247 RETVAL = (SDL_Palette *)safemalloc(sizeof(SDL_Palette));
1248 RETVAL->colors = (SDL_Color *)safemalloc(number *
1250 RETVAL->ncolors = number;
1255 PaletteNColors ( palette, ... )
1256 SDL_Palette *palette
1258 if ( items > 1 ) palette->ncolors = SvIV(ST(1));
1259 RETVAL = palette->ncolors;
1264 PaletteColors ( palette, index, ... )
1265 SDL_Palette *palette
1269 palette->colors[index].r = SvUV(ST(2));
1270 palette->colors[index].g = SvUV(ST(3));
1271 palette->colors[index].b = SvUV(ST(4));
1273 RETVAL = (SDL_Color *)(palette->colors + index);
1278 VideoModeOK ( width, height, bpp, flags )
1284 RETVAL = SDL_VideoModeOK(width,height,bpp,flags);
1289 SetVideoMode ( width, height, bpp, flags )
1295 RETVAL = SDL_SetVideoMode(width,height,bpp,flags);
1300 UpdateRect ( surface, x, y, w ,h )
1301 SDL_Surface *surface
1307 SDL_UpdateRect(surface,x,y,w,h);
1310 UpdateRects ( surface, ... )
1311 SDL_Surface *surface
1313 SDL_Rect *rects, *temp;
1315 if ( items < 2 ) return;
1316 num_rects = items - 1;
1317 rects = (SDL_Rect *)safemalloc(sizeof(SDL_Rect)*items);
1318 for(i=0;i<num_rects;i++) {
1319 temp = (SDL_Rect *)SvIV(ST(i+1));
1320 rects[i].x = temp->x;
1321 rects[i].y = temp->y;
1322 rects[i].w = temp->w;
1323 rects[i].h = temp->h;
1325 SDL_UpdateRects(surface,num_rects,rects);
1330 SDL_Surface *surface
1332 RETVAL = SDL_Flip(surface);
1337 SetColors ( surface, start, ... )
1338 SDL_Surface *surface
1341 SDL_Color *colors,*temp;
1343 if ( items < 3 ) { RETVAL = 0; goto all_done; }
1345 colors = (SDL_Color *)safemalloc(sizeof(SDL_Color)*(length+1));
1346 for ( i = 0; i < length ; i++ ) {
1347 temp = (SDL_Color *)SvIV(ST(i+2));
1348 colors[i].r = temp->r;
1349 colors[i].g = temp->g;
1350 colors[i].b = temp->b;
1352 RETVAL = SDL_SetColors(surface, colors, start, length );
1359 MapRGB ( surface, r, g, b )
1360 SDL_Surface *surface
1365 RETVAL = SDL_MapRGB(surface->format,r,g,b);
1370 MapRGBA ( surface, r, g, b, a )
1371 SDL_Surface *surface
1377 RETVAL = SDL_MapRGBA(surface->format,r,g,b,a);
1382 GetRGB ( surface, pixel )
1383 SDL_Surface *surface
1387 SDL_GetRGB(pixel,surface->format,&r,&g,&b);
1389 av_push(RETVAL,newSViv(r));
1390 av_push(RETVAL,newSViv(g));
1391 av_push(RETVAL,newSViv(b));
1396 GetRGBA ( surface, pixel )
1397 SDL_Surface *surface
1401 SDL_GetRGBA(pixel,surface->format,&r,&g,&b,&a);
1403 av_push(RETVAL,newSViv(r));
1404 av_push(RETVAL,newSViv(g));
1405 av_push(RETVAL,newSViv(b));
1406 av_push(RETVAL,newSViv(a));
1411 SaveBMP ( surface, filename )
1412 SDL_Surface *surface
1415 RETVAL = SDL_SaveBMP(surface,filename);
1420 SetColorKey ( surface, flag, key )
1421 SDL_Surface *surface
1425 Uint32 pixel = SDL_MapRGB(surface->format,key->r,key->g,key->b);
1426 RETVAL = SDL_SetColorKey(surface,flag,pixel);
1431 SetAlpha ( surface, flag, alpha )
1432 SDL_Surface *surface
1436 RETVAL = SDL_SetAlpha(surface,flag,alpha);
1441 DisplayFormat ( surface )
1442 SDL_Surface *surface
1444 RETVAL = SDL_DisplayFormat(surface);
1449 DisplayFormatAlpha ( surface )
1450 SDL_Surface *surface
1452 RETVAL = SDL_DisplayFormatAlpha(surface);
1457 ConvertRGB ( surface )
1458 SDL_Surface * surface
1460 SDL_PixelFormat fmt;
1462 fmt.BitsPerPixel = 24;
1463 fmt.BytesPerPixel = 3;
1464 fmt.Rmask = 0x000000ff;
1465 fmt.Gmask = 0x0000ff00;
1466 fmt.Bmask = 0x00ff0000;
1467 fmt.Amask = 0x00000000;
1478 RETVAL = SDL_ConvertSurface(surface,&fmt,surface->flags);
1483 ConvertRGBA ( surface )
1484 SDL_Surface * surface
1486 SDL_PixelFormat fmt;
1488 fmt.BitsPerPixel = 32;
1489 fmt.BytesPerPixel = 4;
1490 fmt.Rmask = 0x000000ff;
1491 fmt.Gmask = 0x0000ff00;
1492 fmt.Bmask = 0x00ff0000;
1493 fmt.Amask = 0xff000000;
1504 RETVAL = SDL_ConvertSurface(surface,&fmt,surface->flags);
1509 BlitSurface ( src, src_rect, dest, dest_rect )
1515 RETVAL = SDL_BlitSurface(src,src_rect,dest,dest_rect);
1520 FillRect ( dest, dest_rect, color )
1525 Uint32 pixel = SDL_MapRGB(dest->format,color->r,color->g,color->b);
1526 RETVAL = SDL_FillRect(dest,dest_rect,pixel);
1533 RETVAL = SDL_GetAppState();
1539 WMSetCaption ( title, icon )
1543 SDL_WM_SetCaption(title,icon);
1549 SDL_WM_GetCaption(&title,&icon);
1551 av_push(RETVAL,newSVpv(title,0));
1552 av_push(RETVAL,newSVpv(icon,0));
1560 SDL_WM_SetIcon(icon,NULL);
1575 mask = SDL_GetMouseState(&x,&y);
1577 av_push(RETVAL,newSViv(mask));
1578 av_push(RETVAL,newSViv(x));
1579 av_push(RETVAL,newSViv(y));
1584 GetRelativeMouseState ()
1589 mask = SDL_GetRelativeMouseState(&x,&y);
1591 av_push(RETVAL,newSViv(mask));
1592 av_push(RETVAL,newSViv(x));
1593 av_push(RETVAL,newSViv(y));
1598 NewCursor ( data, mask, x ,y )
1604 RETVAL = SDL_CreateCursor((Uint8*)data->pixels,
1605 (Uint8*)mask->pixels,data->w,data->h,x,y);
1610 FreeCursor ( cursor )
1613 SDL_FreeCursor(cursor);
1616 SetCursor ( cursor )
1619 SDL_SetCursor(cursor);
1624 RETVAL = SDL_GetCursor();
1629 ShowCursor ( toggle )
1632 RETVAL = SDL_ShowCursor(toggle);
1637 NewAudioSpec ( freq, format, channels, samples )
1643 RETVAL = (SDL_AudioSpec *)safemalloc(sizeof(SDL_AudioSpec));
1644 RETVAL->freq = freq;
1645 RETVAL->format = format;
1646 RETVAL->channels = channels;
1647 RETVAL->samples = samples;
1652 FreeAudioSpec ( spec )
1658 NewAudioCVT ( src_format, src_channels, src_rate, dst_format, dst_channels, dst_rate)
1666 RETVAL = (SDL_AudioCVT *)safemalloc(sizeof(SDL_AudioCVT));
1667 if (SDL_BuildAudioCVT(RETVAL,src_format, src_channels, src_rate,
1668 dst_format, dst_channels, dst_rate)) {
1669 safefree(RETVAL); RETVAL = NULL; }
1674 FreeAudioCVT ( cvt )
1680 ConvertAudioData ( cvt, data, len )
1686 cvt->buf = (Uint8*) safemalloc(cvt->len*cvt->len_mult);
1687 memcpy(cvt->buf,data,cvt->len);
1688 RETVAL = SDL_ConvertAudio(cvt);
1693 OpenAudio ( spec, callback )
1697 spec->userdata = (void*)callback;
1698 spec->callback = sdl_perl_audio_callback;
1699 RETVAL = SDL_OpenAudio(spec,NULL);
1706 RETVAL = SDL_GetAudioStatus ();
1714 SDL_PauseAudio(p_on);
1738 LoadWAV ( filename, spec )
1742 SDL_AudioSpec *temp;
1747 temp = SDL_LoadWAV(filename,spec,&buf,&len);
1748 if ( ! temp ) goto error;
1749 av_push(RETVAL,newSViv(PTR2IV(temp)));
1750 av_push(RETVAL,newSViv(PTR2IV(buf)));
1751 av_push(RETVAL,newSViv(len));
1756 #ifdef HAVE_SDL_MIXER
1759 MixAudio ( dst, src, len, volume )
1765 SDL_MixAudio(dst,src,len,volume);
1768 MixOpenAudio ( frequency, format, channels, chunksize )
1774 RETVAL = Mix_OpenAudio(frequency, format, channels, chunksize);
1779 MixAllocateChannels ( number )
1782 RETVAL = Mix_AllocateChannels(number);
1789 int freq, channels, status;
1791 status = Mix_QuerySpec(&freq,&format,&channels);
1793 av_push(RETVAL,newSViv(status));
1794 av_push(RETVAL,newSViv(freq));
1795 av_push(RETVAL,newSViv(format));
1796 av_push(RETVAL,newSViv(channels));
1801 MixLoadWAV ( filename )
1804 RETVAL = Mix_LoadWAV(filename);
1809 MixLoadMusic ( filename )
1812 RETVAL = Mix_LoadMUS(filename);
1817 MixQuickLoadWAV ( buf )
1820 RETVAL = Mix_QuickLoad_WAV(buf);
1825 MixFreeChunk( chunk )
1828 Mix_FreeChunk(chunk);
1831 MixFreeMusic ( music )
1834 Mix_FreeMusic(music);
1837 MixSetPostMixCallback ( func, arg )
1841 Mix_SetPostMix(func,arg);
1846 RETVAL = sdl_perl_music_callback;
1851 MixSetMusicHook ( func, arg )
1855 Mix_HookMusic(func,arg);
1858 MixSetMusicFinishedHook ( func )
1861 mix_music_finished_cv = func;
1862 Mix_HookMusicFinished(sdl_perl_music_finished_callback);
1865 MixGetMusicHookData ()
1867 RETVAL = Mix_GetMusicHookData();
1872 MixReverseChannels ( number )
1875 RETVAL = Mix_ReserveChannels ( number );
1880 MixGroupChannel ( which, tag )
1884 RETVAL = Mix_GroupChannel(which,tag);
1889 MixGroupChannels ( from, to, tag )
1894 RETVAL = Mix_GroupChannels(from,to,tag);
1899 MixGroupAvailable ( tag )
1902 RETVAL = Mix_GroupAvailable(tag);
1907 MixGroupCount ( tag )
1910 RETVAL = Mix_GroupCount(tag);
1915 MixGroupOldest ( tag )
1918 RETVAL = Mix_GroupOldest(tag);
1923 MixGroupNewer ( tag )
1926 RETVAL = Mix_GroupNewer(tag);
1931 MixPlayChannel ( channel, chunk, loops )
1936 RETVAL = Mix_PlayChannel(channel,chunk,loops);
1941 MixSetPanning ( channel, left, right )
1946 RETVAL = Mix_SetPanning(channel,left, right);
1952 MixPlayChannelTimed ( channel, chunk, loops, ticks )
1958 RETVAL = Mix_PlayChannelTimed(channel,chunk,loops,ticks);
1963 MixPlayMusic ( music, loops )
1967 RETVAL = Mix_PlayMusic(music,loops);
1972 MixFadeInChannel ( channel, chunk, loops, ms )
1978 RETVAL = Mix_FadeInChannel(channel,chunk,loops,ms);
1983 MixFadeInChannelTimed ( channel, chunk, loops, ms, ticks )
1990 RETVAL = Mix_FadeInChannelTimed(channel,chunk,loops,ms,ticks);
1995 MixFadeInMusic ( music, loops, ms )
2000 RETVAL = Mix_FadeInMusic(music,loops,ms);
2005 MixVolume ( channel, volume )
2009 RETVAL = Mix_Volume(channel,volume);
2014 MixVolumeChunk ( chunk, volume )
2018 RETVAL = Mix_VolumeChunk(chunk,volume);
2023 MixVolumeMusic ( volume )
2026 RETVAL = Mix_VolumeMusic(volume);
2031 MixHaltChannel ( channel )
2034 RETVAL = Mix_HaltChannel(channel);
2039 MixHaltGroup ( tag )
2042 RETVAL = Mix_HaltGroup(tag);
2049 RETVAL = Mix_HaltMusic();
2054 MixExpireChannel ( channel, ticks )
2058 RETVAL = Mix_ExpireChannel ( channel,ticks);
2063 MixFadeOutChannel ( which, ms )
2067 RETVAL = Mix_FadeOutChannel(which,ms);
2072 MixFadeOutGroup ( which, ms )
2076 RETVAL = Mix_FadeOutGroup(which,ms);
2081 MixFadeOutMusic ( ms )
2084 RETVAL = Mix_FadeOutMusic(ms);
2091 RETVAL = Mix_FadingMusic();
2096 MixFadingChannel( which )
2099 RETVAL = Mix_FadingChannel(which);
2104 MixPause ( channel )
2110 MixResume ( channel )
2113 Mix_Resume(channel);
2116 MixPaused ( channel )
2119 RETVAL = Mix_Paused(channel);
2141 RETVAL = Mix_PausedMusic();
2146 MixPlaying( channel )
2149 RETVAL = Mix_Playing(channel);
2156 RETVAL = Mix_PlayingMusic();
2169 GLLoadLibrary ( path )
2172 RETVAL = SDL_GL_LoadLibrary(path);
2177 GLGetProcAddress ( proc )
2180 RETVAL = SDL_GL_GetProcAddress(proc);
2185 GLSetAttribute ( attr, value )
2189 RETVAL = SDL_GL_SetAttribute(attr, value);
2194 GLGetAttribute ( attr )
2199 av_push(RETVAL,newSViv(SDL_GL_GetAttribute(attr, &value)));
2200 av_push(RETVAL,newSViv(value));
2207 SDL_GL_SwapBuffers ();
2213 RETVAL = (SDL_BYTEORDER == SDL_BIG_ENDIAN);
2220 RETVAL = SDL_NumJoysticks();
2225 JoystickName ( index )
2228 RETVAL = (char*)SDL_JoystickName(index);
2233 JoystickOpen ( index )
2236 RETVAL = SDL_JoystickOpen(index);
2241 JoystickOpened ( index )
2244 RETVAL = SDL_JoystickOpened(index);
2249 JoystickIndex ( joystick )
2250 SDL_Joystick *joystick
2252 RETVAL = SDL_JoystickIndex(joystick);
2257 JoystickNumAxes ( joystick )
2258 SDL_Joystick *joystick
2260 RETVAL = SDL_JoystickNumAxes(joystick);
2265 JoystickNumBalls ( joystick )
2266 SDL_Joystick *joystick
2268 RETVAL = SDL_JoystickNumBalls(joystick);
2273 JoystickNumHats ( joystick )
2274 SDL_Joystick *joystick
2276 RETVAL = SDL_JoystickNumHats(joystick);
2281 JoystickNumButtons ( joystick )
2282 SDL_Joystick *joystick
2284 RETVAL = SDL_JoystickNumButtons(joystick);
2291 SDL_JoystickUpdate();
2294 JoystickGetAxis ( joystick, axis )
2295 SDL_Joystick *joystick
2298 RETVAL = SDL_JoystickGetAxis(joystick,axis);
2303 JoystickGetHat ( joystick, hat )
2304 SDL_Joystick *joystick
2307 RETVAL = SDL_JoystickGetHat(joystick,hat);
2312 JoystickGetButton ( joystick, button)
2313 SDL_Joystick *joystick
2316 RETVAL = SDL_JoystickGetButton(joystick,button);
2321 JoystickGetBall ( joystick, ball )
2322 SDL_Joystick *joystick
2326 success = SDL_JoystickGetBall(joystick,ball,&dx,&dy);
2328 av_push(RETVAL,newSViv(success));
2329 av_push(RETVAL,newSViv(dx));
2330 av_push(RETVAL,newSViv(dy));
2335 JoystickClose ( joystick )
2336 SDL_Joystick *joystick
2338 SDL_JoystickClose(joystick);
2341 JoyAxisEventWhich ( e )
2344 RETVAL = e->jaxis.which;
2349 JoyAxisEventAxis ( e )
2352 RETVAL = e->jaxis.axis;
2357 JoyAxisEventValue ( e )
2360 RETVAL = e->jaxis.value;
2365 JoyButtonEventWhich ( e )
2368 RETVAL = e->jbutton.which;
2373 JoyButtonEventButton ( e )
2376 RETVAL = e->jbutton.button;
2381 JoyButtonEventState ( e )
2384 RETVAL = e->jbutton.state;
2389 JoyHatEventWhich ( e )
2392 RETVAL = e->jhat.which;
2397 JoyHatEventHat ( e )
2400 RETVAL = e->jhat.hat;
2405 JoyHatEventValue ( e )
2408 RETVAL = e->jhat.value;
2413 JoyBallEventWhich ( e )
2416 RETVAL = e->jball.which;
2421 JoyBallEventBall ( e )
2424 RETVAL = e->jball.ball;
2429 JoyBallEventXrel ( e )
2432 RETVAL = e->jball.xrel;
2437 JoyBallEventYrel ( e )
2440 RETVAL = e->jball.yrel;
2445 SetClipRect ( surface, rect )
2446 SDL_Surface *surface
2449 SDL_SetClipRect(surface,rect);
2452 GetClipRect ( surface )
2453 SDL_Surface *surface
2455 RETVAL = (SDL_Rect*) safemalloc(sizeof(SDL_Rect));
2456 SDL_GetClipRect(surface,RETVAL);
2466 RETVAL = SDLNet_Init();
2476 NetNewIPaddress ( host, port )
2480 RETVAL = (IPaddress*) safemalloc(sizeof(IPaddress));
2481 RETVAL->host = host;
2482 RETVAL->port = port;
2487 NetIPaddressHost ( ip )
2495 NetIPaddressPort ( ip )
2503 NetFreeIPaddress ( ip )
2509 NetResolveIP ( address )
2512 RETVAL = SDLNet_ResolveIP(address);
2517 NetResolveHost ( address, host, port )
2522 RETVAL = SDLNet_ResolveHost(address,host,port);
2530 RETVAL = SDLNet_TCP_Open(ip);
2535 NetTCPAccept ( server )
2538 RETVAL = SDLNet_TCP_Accept(server);
2543 NetTCPGetPeerAddress ( sock )
2546 RETVAL = SDLNet_TCP_GetPeerAddress(sock);
2551 NetTCPSend ( sock, data, len )
2556 RETVAL = SDLNet_TCP_Send(sock,data,len);
2561 NetTCPRecv ( sock, maxlen )
2567 buffer = safemalloc(maxlen);
2569 status = SDLNet_TCP_Recv(sock,buffer,maxlen);
2570 av_push(RETVAL,newSViv(status));
2571 av_push(RETVAL,newSVpvn((char*)buffer,maxlen));
2576 NetTCPClose ( sock )
2579 SDLNet_TCP_Close(sock);
2582 NetAllocPacket ( size )
2585 RETVAL = SDLNet_AllocPacket(size);
2590 NetAllocPacketV ( howmany, size )
2594 RETVAL = SDLNet_AllocPacketV(howmany,size);
2599 NetResizePacket ( packet, newsize )
2603 RETVAL = SDLNet_ResizePacket(packet,newsize);
2608 NetFreePacket ( packet )
2611 SDLNet_FreePacket(packet);
2614 NetFreePacketV ( packet )
2617 SDLNet_FreePacketV(packet);
2623 RETVAL = SDLNet_UDP_Open(port);
2628 NetUDPBind ( sock, channel, address )
2633 RETVAL = SDLNet_UDP_Bind(sock,channel,address);
2638 NetUDPUnbind ( sock, channel )
2642 SDLNet_UDP_Unbind(sock,channel);
2645 NetUDPGetPeerAddress ( sock, channel )
2649 RETVAL = SDLNet_UDP_GetPeerAddress(sock,channel);
2654 NetUDPSendV ( sock, packets, npackets )
2659 RETVAL = SDLNet_UDP_SendV(sock,packets,npackets);
2664 NetUDPSend ( sock, channel, packet )
2669 RETVAL = SDLNet_UDP_Send(sock,channel,packet);
2674 NetUDPRecvV ( sock, packets )
2678 RETVAL = SDLNet_UDP_RecvV(sock,packets);
2683 NetUDPRecv ( sock, packet )
2687 RETVAL = SDLNet_UDP_Recv(sock,packet);
2692 NetUDPClose ( sock )
2695 SDLNet_UDP_Close(sock);
2698 NetAllocSocketSet ( maxsockets )
2701 RETVAL = SDLNet_AllocSocketSet(maxsockets);
2706 NetTCP_AddSocket ( set, sock )
2707 SDLNet_SocketSet set
2710 RETVAL = SDLNet_TCP_AddSocket(set,sock);
2715 NetUDP_AddSocket ( set, sock )
2716 SDLNet_SocketSet set
2719 RETVAL = SDLNet_UDP_AddSocket(set,sock);
2724 NetTCP_DelSocket ( set, sock )
2725 SDLNet_SocketSet set
2728 RETVAL = SDLNet_TCP_DelSocket(set,sock);
2733 NetUDP_DelSocket ( set, sock )
2734 SDLNet_SocketSet set
2737 RETVAL = SDLNet_UDP_DelSocket(set,sock);
2742 NetCheckSockets ( set, timeout )
2743 SDLNet_SocketSet set
2746 RETVAL = SDLNet_CheckSockets(set,timeout);
2751 NetSocketReady ( sock )
2752 SDLNet_GenericSocket sock
2754 RETVAL = SDLNet_SocketReady(sock);
2759 NetFreeSocketSet ( set )
2760 SDLNet_SocketSet set
2762 SDLNet_FreeSocketSet(set);
2765 NetWrite16 ( value, area )
2769 SDLNet_Write16(value,area);
2772 NetWrite32 ( value, area )
2776 SDLNet_Write32(value,area);
2782 RETVAL = SDLNet_Read16(area);
2790 RETVAL = SDLNet_Read32(area);
2801 RETVAL = TTF_Init();
2811 TTFOpenFont ( file, ptsize )
2815 RETVAL = TTF_OpenFont(file,ptsize);
2820 TTFGetFontStyle ( font )
2823 RETVAL = TTF_GetFontStyle(font);
2828 TTFSetFontStyle ( font, style )
2832 TTF_SetFontStyle(font,style);
2835 TTFFontHeight ( font )
2838 RETVAL = TTF_FontHeight(font);
2843 TTFFontAscent ( font )
2846 RETVAL = TTF_FontAscent(font);
2851 TTFFontDescent ( font )
2854 RETVAL = TTF_FontDescent(font);
2859 TTFFontLineSkip ( font )
2862 RETVAL = TTF_FontLineSkip(font);
2867 TTFGlyphMetrics ( font, ch )
2871 int minx, miny, maxx, maxy, advance;
2873 TTF_GlyphMetrics(font, ch, &minx, &miny, &maxx, &maxy, &advance);
2874 av_push(RETVAL,newSViv(minx));
2875 av_push(RETVAL,newSViv(miny));
2876 av_push(RETVAL,newSViv(maxx));
2877 av_push(RETVAL,newSViv(maxy));
2878 av_push(RETVAL,newSViv(advance));
2883 TTFSizeText ( font, text )
2889 TTF_SizeText(font,text,&w,&h);
2890 av_push(RETVAL,newSViv(w));
2891 av_push(RETVAL,newSViv(h));
2896 TTFSizeUTF8 ( font, text )
2902 TTF_SizeUTF8(font,text,&w,&h);
2903 av_push(RETVAL,newSViv(w));
2904 av_push(RETVAL,newSViv(h));
2909 TTFSizeUNICODE ( font, text )
2915 TTF_SizeUNICODE(font,text,&w,&h);
2916 av_push(RETVAL,newSViv(w));
2917 av_push(RETVAL,newSViv(h));
2922 TTFRenderTextSolid ( font, text, fg )
2927 RETVAL = TTF_RenderText_Solid(font,text,*fg);
2932 TTFRenderUTF8Solid ( font, text, fg )
2937 RETVAL = TTF_RenderUTF8_Solid(font,text,*fg);
2942 TTFRenderUNICODESolid ( font, text, fg )
2947 RETVAL = TTF_RenderUNICODE_Solid(font,text,*fg);
2952 TTFRenderGlyphSolid ( font, ch, fg )
2957 RETVAL = TTF_RenderGlyph_Solid(font,ch,*fg);
2962 TTFRenderTextShaded ( font, text, fg, bg )
2968 RETVAL = TTF_RenderText_Shaded(font,text,*fg,*bg);
2973 TTFRenderUTF8Shaded( font, text, fg, bg )
2979 RETVAL = TTF_RenderUTF8_Shaded(font,text,*fg,*bg);
2984 TTFRenderUNICODEShaded( font, text, fg, bg )
2990 RETVAL = TTF_RenderUNICODE_Shaded(font,text,*fg,*bg);
2995 TTFRenderGlyphShaded ( font, ch, fg, bg )
3001 RETVAL = TTF_RenderGlyph_Shaded(font,ch,*fg,*bg);
3006 TTFRenderTextBlended( font, text, fg )
3011 RETVAL = TTF_RenderText_Blended(font,text,*fg);
3016 TTFRenderUTF8Blended( font, text, fg )
3021 RETVAL = TTF_RenderUTF8_Blended(font,text,*fg);
3026 TTFRenderUNICODEBlended( font, text, fg )
3031 RETVAL = TTF_RenderUNICODE_Blended(font,text,*fg);
3036 TTFRenderGlyphBlended( font, ch, fg )
3041 RETVAL = TTF_RenderGlyph_Blended(font,ch,*fg);
3046 TTFCloseFont ( font )
3049 TTF_CloseFont(font);
3052 TTFPutString ( font, mode, surface, x, y, fg, bg, text )
3055 SDL_Surface *surface
3070 img = TTF_RenderText_Solid(font,text,*fg);
3071 TTF_SizeText(font,text,&w,&h);
3076 img = TTF_RenderText_Shaded(font,text,*fg,*bg);
3077 TTF_SizeText(font,text,&w,&h);
3082 img = TTF_RenderText_Blended(font,text,*fg);
3083 TTF_SizeText(font,text,&w,&h);
3088 img = TTF_RenderUTF8_Solid(font,text,*fg);
3089 TTF_SizeUTF8(font,text,&w,&h);
3094 img = TTF_RenderUTF8_Shaded(font,text,*fg,*bg);
3095 TTF_SizeUTF8(font,text,&w,&h);
3100 img = TTF_RenderUTF8_Blended(font,text,*fg);
3101 TTF_SizeUTF8(font,text,&w,&h);
3106 img = TTF_RenderUNICODE_Solid(font,(Uint16*)text,*fg);
3107 TTF_SizeUNICODE(font,(Uint16*)text,&w,&h);
3111 case UNICODE_SHADED:
3112 img = TTF_RenderUNICODE_Shaded(font,(Uint16*)text,*fg,*bg);
3113 TTF_SizeUNICODE(font,(Uint16*)text,&w,&h);
3117 case UNICODE_BLENDED:
3118 img = TTF_RenderUNICODE_Blended(font,(Uint16*)text,*fg);
3119 TTF_SizeUNICODE(font,(Uint16*)text,&w,&h);
3124 img = TTF_RenderText_Shaded(font,text,*fg,*bg);
3125 TTF_SizeText(font,text,&w,&h);
3129 if ( img && img->format && img->format->palette ) {
3130 SDL_Color *c = &img->format->palette->colors[0];
3131 Uint32 key = SDL_MapRGB( img->format, c->r, c->g, c->b );
3132 SDL_SetColorKey(img,SDL_SRCCOLORKEY,key );
3133 if (0 > SDL_BlitSurface(img,NULL,surface,&dest)) {
3134 SDL_FreeSurface(img);
3146 CreateYUVOverlay ( width, height, format, display )
3150 SDL_Surface *display
3152 RETVAL = SDL_CreateYUVOverlay ( width, height, format, display );
3157 LockYUVOverlay ( overlay )
3158 SDL_Overlay *overlay
3160 RETVAL = SDL_LockYUVOverlay(overlay);
3165 UnlockYUVOverlay ( overlay )
3166 SDL_Overlay *overlay
3168 SDL_UnlockYUVOverlay(overlay);
3171 DisplayYUVOverlay ( overlay, dstrect )
3172 SDL_Overlay *overlay
3175 RETVAL = SDL_DisplayYUVOverlay ( overlay, dstrect );
3180 FreeYUVOverlay ( overlay )
3181 SDL_Overlay *overlay
3183 SDL_FreeYUVOverlay ( overlay );
3186 OverlayFormat ( overlay, ... )
3187 SDL_Overlay *overlay
3190 overlay->format = SvIV(ST(1));
3191 RETVAL = overlay->format;
3196 OverlayW ( overlay, ... )
3197 SDL_Overlay *overlay
3200 overlay->w = SvIV(ST(1));
3201 RETVAL = overlay->w;
3206 OverlayH ( overlay, ... )
3207 SDL_Overlay *overlay
3210 overlay->h = SvIV(ST(1));
3211 RETVAL = overlay->h;
3216 OverlayPlanes ( overlay, ... )
3217 SDL_Overlay *overlay
3220 overlay->planes = SvIV(ST(1));
3221 RETVAL = overlay->planes;
3226 OverlayHW ( overlay )
3227 SDL_Overlay *overlay
3229 RETVAL = overlay->hw_overlay;
3234 OverlayPitches ( overlay )
3235 SDL_Overlay *overlay
3237 RETVAL = overlay->pitches;
3242 OverlayPixels ( overlay )
3243 SDL_Overlay *overlay
3245 RETVAL = overlay->pixels;
3250 WMToggleFullScreen ( surface )
3251 SDL_Surface *surface
3253 RETVAL = SDL_WM_ToggleFullScreen(surface);
3258 WMGrabInput ( mode )
3261 RETVAL = SDL_WM_GrabInput(mode);
3268 RETVAL = SDL_WM_IconifyWindow();
3276 RETVAL = e->resize.w;
3284 RETVAL = e->resize.h;
3292 RETVAL = SDL_AudioDriverName(name,32);
3300 if (k >= SDLK_LAST) Perl_croak (aTHX_ "Key out of range");
3301 RETVAL = SDL_GetKeyState(NULL)[k];
3310 RETVAL = (SMPEG_Info *) safemalloc (sizeof(SMPEG_Info));
3315 FreeSMPEGInfo ( info )
3321 SMPEGInfoHasAudio ( info )
3324 RETVAL = info->has_audio;
3329 SMPEGInfoHasVideo ( info )
3332 RETVAL = info->has_video;
3337 SMPEGInfoWidth ( info )
3340 RETVAL = info->width;
3345 SMPEGInfoHeight ( info )
3348 RETVAL = info->height;
3353 SMPEGInfoCurrentFrame ( info )
3356 RETVAL = info->current_frame;
3361 SMPEGInfoCurrentFPS ( info )
3364 RETVAL = info->current_fps;
3369 SMPEGInfoCurrentAudioFrame ( info )
3372 RETVAL = info->audio_current_frame;
3377 SMPEGInfoCurrentOffset ( info )
3380 RETVAL = info->current_offset;
3385 SMPEGInfoTotalSize ( info )
3388 RETVAL = info->total_size;
3393 SMPEGInfoCurrentTime ( info )
3396 RETVAL = info->current_time;
3401 SMPEGInfoTotalTime ( info )
3404 RETVAL = info->total_time;
3412 RETVAL = SMPEG_error(mpeg);
3417 NewSMPEG ( filename, info, use_audio )
3422 #ifdef HAVE_SDL_MIXER
3423 RETVAL = SMPEG_new(filename,info,0);
3425 RETVAL = SMPEG_new(filename,info,use_audio);
3437 SMPEGEnableAudio ( mpeg , flag )
3441 SMPEG_enableaudio(mpeg,flag);
3442 #ifdef HAVE_SDL_MIXER
3443 sdl_perl_use_smpeg_audio = flag;
3447 SMPEGEnableVideo ( mpeg , flag )
3451 SMPEG_enablevideo(mpeg,flag);
3454 SMPEGSetVolume ( mpeg , volume )
3458 SMPEG_setvolume(mpeg,volume);
3461 SMPEGSetDisplay ( mpeg, dest, surfLock )
3464 SDL_mutex* surfLock;
3466 SMPEG_setdisplay(mpeg,dest,surfLock,NULL);
3469 SMPEGScaleXY ( mpeg, w, h)
3474 SMPEG_scaleXY(mpeg,w,h);
3477 SMPEGScale ( mpeg, scale )
3481 SMPEG_scale(mpeg,scale);
3487 SDL_AudioSpec audiofmt;
3490 #ifdef HAVE_SDL_MIXER
3491 if (sdl_perl_use_smpeg_audio ) {
3492 SMPEG_enableaudio(mpeg, 0);
3493 Mix_QuerySpec(&freq, &format, &channels);
3494 audiofmt.format = format;
3495 audiofmt.freq = freq;
3496 audiofmt.channels = channels;
3497 SMPEG_actualSpec(mpeg, &audiofmt);
3498 Mix_HookMusic(SMPEG_playAudioSDL, mpeg);
3499 SMPEG_enableaudio(mpeg, 1);
3505 SMPEGStatus ( mpeg )
3508 RETVAL = SMPEG_status(mpeg);
3519 SMPEGLoop ( mpeg, repeat )
3523 SMPEG_loop(mpeg,repeat);
3530 #ifdef HAVE_SDL_MIXER
3531 Mix_HookMusic(NULL, NULL);
3535 SMPEGRewind ( mpeg )
3541 SMPEGSeek ( mpeg, bytes )
3545 SMPEG_seek(mpeg,bytes);
3548 SMPEGSkip ( mpeg, seconds )
3552 SMPEG_skip(mpeg,seconds);
3555 SMPEGSetDisplayRegion ( mpeg, rect )
3559 SMPEG_setdisplayregion(mpeg,rect->x,rect->y,rect->w,rect->h);
3562 SMPEGRenderFrame ( mpeg, frame )
3566 SMPEG_renderFrame(mpeg,frame);
3569 SMPEGGetInfo ( mpeg )
3572 RETVAL = (SMPEG_Info *) safemalloc (sizeof(SMPEG_Info));
3573 SMPEG_getinfo(mpeg,RETVAL);
3583 GFXRotoZoom ( src, angle, zoom, smooth)
3589 RETVAL = rotozoomSurface( src, angle, zoom, smooth);
3594 GFXZoom ( src, zoomx, zoomy, smooth)
3600 RETVAL = zoomSurface( src, zoomx, zoomy, smooth);
3606 GFXPixelColor ( dst, x, y, color )
3612 RETVAL = pixelColor( dst, x, y, color);
3617 GFXPixelRGBA ( dst, x, y, r, g, b, a )
3626 RETVAL = pixelRGBA( dst, x, y, r, g, b, a );
3631 GFXHlineColor ( dst, x1, x2, y, color )
3638 RETVAL = hlineColor( dst, x1, x2, y, color );
3643 GFXHlineRGBA ( dst, x1, x2, y, r, g, b, a )
3653 RETVAL = hlineRGBA( dst, x1, x2, y, r, g, b, a );
3658 GFXVlineColor ( dst, x, y1, y2, color )
3665 RETVAL = vlineColor( dst, x, y1, y2, color );
3670 GFXVlineRGBA ( dst, x, y1, y2, r, g, b, a )
3680 RETVAL = vlineRGBA( dst, x, y1, y2, r, g, b, a );
3685 GFXRectangleColor ( dst, x1, y1, x2, y2, color )
3693 RETVAL = rectangleColor( dst, x1, y1, x2, y2, color );
3698 GFXRectangleRGBA ( dst, x1, y1, x2, y2, r, g, b, a )
3709 RETVAL = rectangleRGBA( dst, x1, y1, x2, y2, r, g, b, a );
3714 GFXBoxColor ( dst, x1, y1, x2, y2, color )
3722 RETVAL = boxColor( dst, x1, y1, x2, y2, color );
3727 GFXBoxRGBA ( dst, x1, y1, x2, y2, r, g, b, a )
3738 RETVAL = boxRGBA( dst, x1, y1, x2, y2, r, g, b, a );
3743 GFXLineColor ( dst, x1, y1, x2, y2, color )
3751 RETVAL = lineColor( dst, x1, y1, x2, y2, color );
3756 GFXLineRGBA ( dst, x1, y1, x2, y2, r, g, b, a )
3767 RETVAL = lineRGBA( dst, x1, y1, x2, y2, r, g, b, a );
3772 GFXAalineColor ( dst, x1, y1, x2, y2, color )
3780 RETVAL = aalineColor( dst, x1, y1, x2, y2, color );
3785 GFXAalineRGBA ( dst, x1, y1, x2, y2, r, g, b, a )
3796 RETVAL = aalineRGBA( dst, x1, y1, x2, y2, r, g, b, a );
3801 GFXCircleColor ( dst, x, y, r, color )
3808 RETVAL = circleColor( dst, x, y, r, color );
3813 GFXCircleRGBA ( dst, x, y, rad, r, g, b, a )
3823 RETVAL = circleRGBA( dst, x, y, rad, r, g, b, a );
3828 GFXAacircleColor ( dst, x, y, r, color )
3835 RETVAL = aacircleColor( dst, x, y, r, color );
3840 GFXAacircleRGBA ( dst, x, y, rad, r, g, b, a )
3850 RETVAL = aacircleRGBA( dst, x, y, rad, r, g, b, a );
3855 GFXFilledCircleColor ( dst, x, y, r, color )
3862 RETVAL = filledCircleColor( dst, x, y, r, color );
3867 GFXFilledCircleRGBA ( dst, x, y, rad, r, g, b, a )
3877 RETVAL = filledCircleRGBA( dst, x, y, rad, r, g, b, a );
3882 GFXEllipseColor ( dst, x, y, rx, ry, color )
3890 RETVAL = ellipseColor( dst, x, y, rx, ry, color );
3895 GFXEllipseRGBA ( dst, x, y, rx, ry, r, g, b, a )
3906 RETVAL = ellipseRGBA( dst, x, y, rx, ry, r, g, b, a );
3911 GFXAaellipseColor ( dst, xc, yc, rx, ry, color )
3919 RETVAL = aaellipseColor( dst, xc, yc, rx, ry, color );
3924 GFXAaellipseRGBA ( dst, x, y, rx, ry, r, g, b, a )
3935 RETVAL = aaellipseRGBA( dst, x, y, rx, ry, r, g, b, a );
3940 GFXFilledEllipseColor ( dst, x, y, rx, ry, color )
3948 RETVAL = filledEllipseColor( dst, x, y, rx, ry, color );
3953 GFXFilledEllipseRGBA ( dst, x, y, rx, ry, r, g, b, a )
3964 RETVAL = filledEllipseRGBA( dst, x, y, rx, ry, r, g, b, a );
3969 GFXFilledPieColor ( dst, x, y, rad, start, end, color )
3978 RETVAL = filledPieColor( dst, x, y, rad, start, end, color );
3983 GFXFilledPieRGBA ( dst, x, y, rad, start, end, r, g, b, a )
3995 RETVAL = filledPieRGBA( dst, x, y, rad, start, end, r, g, b, a );
4000 GFXPolygonColor ( dst, vx, vy, n, color )
4007 RETVAL = polygonColor( dst, vx, vy, n, color );
4012 GFXPolygonRGBA ( dst, vx, vy, n, r, g, b, a )
4022 RETVAL = polygonRGBA( dst, vx, vy, n, r, g, b, a );
4027 GFXAapolygonColor ( dst, vx, vy, n, color )
4034 RETVAL = aapolygonColor( dst, vx, vy, n, color );
4039 GFXAapolygonRGBA ( dst, vx, vy, n, r, g, b, a )
4049 RETVAL = aapolygonRGBA( dst, vx, vy, n, r, g, b, a );
4054 GFXFilledPolygonColor ( dst, vx, vy, n, color )
4061 RETVAL = filledPolygonColor( dst, vx, vy, n, color );
4066 GFXFilledPolygonRGBA ( dst, vx, vy, n, r, g, b, a )
4076 RETVAL = filledPolygonRGBA( dst, vx, vy, n, r, g, b, a );
4081 GFXCharacterColor ( dst, x, y, c, color )
4088 RETVAL = characterColor( dst, x, y, c, color );
4093 GFXCharacterRGBA ( dst, x, y, c, r, g, b, a )
4103 RETVAL = characterRGBA( dst, x, y, c, r, g, b, a );
4108 GFXStringColor ( dst, x, y, c, color )
4115 RETVAL = stringColor( dst, x, y, c, color );
4120 GFXStringRGBA ( dst, x, y, c, r, g, b, a )
4130 RETVAL = stringRGBA( dst, x, y, c, r, g, b, a );
4136 #ifdef HAVE_SDL_SOUND
4139 SoundAudioInfoFormat ( audioinfo )
4140 Sound_AudioInfo* audioinfo
4142 RETVAL = audioinfo->format;
4147 SoundAudioInfoChannels ( audioinfo )
4148 Sound_AudioInfo* audioinfo
4150 RETVAL = audioinfo->channels;
4155 SoundAudioInforate ( audioinfo )
4156 Sound_AudioInfo* audioinfo
4158 RETVAL = audioinfo->rate;
4163 SoundDecoderInfoExtensions ( decoderinfo )
4164 Sound_DecoderInfo* decoderinfo
4167 for ( ext = decoderinfo->extensions; *ext != NULL; ext++ ){
4168 av_push(RETVAL,sv_2mortal(newSVpv(*ext,0)));
4174 SoundDecoderInfoDescription ( decoderinfo )
4175 Sound_DecoderInfo* decoderinfo
4177 RETVAL = decoderinfo->description;
4182 SoundDecoderInfoAuthor ( decoderinfo )
4183 Sound_DecoderInfo* decoderinfo
4185 RETVAL = decoderinfo->author;
4190 SoundDecoderInfoUrl ( decoderinfo )
4191 Sound_DecoderInfo* decoderinfo
4193 RETVAL = decoderinfo->url;
4197 const Sound_DecoderInfo*
4198 SoundSampleDecoder ( sample )
4199 Sound_Sample* sample
4201 RETVAL = sample->decoder;
4206 SoundSampleDesired ( sample )
4207 Sound_Sample* sample
4209 RETVAL = &sample->desired;
4214 SoundSampleAcutal ( sample )
4215 Sound_Sample* sample
4217 RETVAL = &sample->actual;
4222 SoundSampleBuffer ( sample )
4223 Sound_Sample* sample
4225 RETVAL = sample->buffer;
4230 SoundSampleBufferSize ( sample )
4231 Sound_Sample* sample
4233 RETVAL = sample->buffer;
4238 SoundSampleFlags ( sample )
4239 Sound_Sample* sample
4241 RETVAL = (Uint32)sample->flags;
4249 MODULE = SDL PACKAGE = SDL
4250 PROTOTYPES : DISABLE