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));
1214 return; safefree(color);
1217 NewPalette ( number )
1220 RETVAL = (SDL_Palette *)safemalloc(sizeof(SDL_Palette));
1221 RETVAL->colors = (SDL_Color *)safemalloc(number *
1223 RETVAL->ncolors = number;
1228 PaletteNColors ( palette, ... )
1229 SDL_Palette *palette
1231 if ( items > 1 ) palette->ncolors = SvIV(ST(1));
1232 RETVAL = palette->ncolors;
1237 PaletteColors ( palette, index, ... )
1238 SDL_Palette *palette
1242 palette->colors[index].r = SvUV(ST(2));
1243 palette->colors[index].g = SvUV(ST(3));
1244 palette->colors[index].b = SvUV(ST(4));
1246 RETVAL = (SDL_Color *)(palette->colors + index);
1251 VideoModeOK ( width, height, bpp, flags )
1257 RETVAL = SDL_VideoModeOK(width,height,bpp,flags);
1262 SetVideoMode ( width, height, bpp, flags )
1268 RETVAL = SDL_SetVideoMode(width,height,bpp,flags);
1273 UpdateRect ( surface, x, y, w ,h )
1274 SDL_Surface *surface
1280 SDL_UpdateRect(surface,x,y,w,h);
1283 UpdateRects ( surface, ... )
1284 SDL_Surface *surface
1286 SDL_Rect *rects, *temp;
1288 if ( items < 2 ) return;
1289 num_rects = items - 1;
1290 rects = (SDL_Rect *)safemalloc(sizeof(SDL_Rect)*items);
1291 for(i=0;i<num_rects;i++) {
1292 temp = (SDL_Rect *)SvIV(ST(i+1));
1293 rects[i].x = temp->x;
1294 rects[i].y = temp->y;
1295 rects[i].w = temp->w;
1296 rects[i].h = temp->h;
1298 SDL_UpdateRects(surface,num_rects,rects);
1303 SDL_Surface *surface
1305 RETVAL = SDL_Flip(surface);
1310 SetColors ( surface, start, ... )
1311 SDL_Surface *surface
1314 SDL_Color *colors,*temp;
1316 if ( items < 3 ) { RETVAL = 0; goto all_done; }
1318 colors = (SDL_Color *)safemalloc(sizeof(SDL_Color)*(length+1));
1319 for ( i = 0; i < length ; i++ ) {
1320 temp = (SDL_Color *)SvIV(ST(i+2));
1321 colors[i].r = temp->r;
1322 colors[i].g = temp->g;
1323 colors[i].b = temp->b;
1325 RETVAL = SDL_SetColors(surface, colors, start, length );
1332 MapRGB ( surface, r, g, b )
1333 SDL_Surface *surface
1338 RETVAL = SDL_MapRGB(surface->format,r,g,b);
1343 MapRGBA ( surface, r, g, b, a )
1344 SDL_Surface *surface
1350 RETVAL = SDL_MapRGBA(surface->format,r,g,b,a);
1355 GetRGB ( surface, pixel )
1356 SDL_Surface *surface
1360 SDL_GetRGB(pixel,surface->format,&r,&g,&b);
1362 av_push(RETVAL,newSViv(r));
1363 av_push(RETVAL,newSViv(g));
1364 av_push(RETVAL,newSViv(b));
1369 GetRGBA ( surface, pixel )
1370 SDL_Surface *surface
1374 SDL_GetRGBA(pixel,surface->format,&r,&g,&b,&a);
1376 av_push(RETVAL,newSViv(r));
1377 av_push(RETVAL,newSViv(g));
1378 av_push(RETVAL,newSViv(b));
1379 av_push(RETVAL,newSViv(a));
1384 SaveBMP ( surface, filename )
1385 SDL_Surface *surface
1388 RETVAL = SDL_SaveBMP(surface,filename);
1393 SetColorKey ( surface, flag, key )
1394 SDL_Surface *surface
1398 Uint32 pixel = SDL_MapRGB(surface->format,key->r,key->g,key->b);
1399 RETVAL = SDL_SetColorKey(surface,flag,pixel);
1404 SetAlpha ( surface, flag, alpha )
1405 SDL_Surface *surface
1409 RETVAL = SDL_SetAlpha(surface,flag,alpha);
1414 DisplayFormat ( surface )
1415 SDL_Surface *surface
1417 RETVAL = SDL_DisplayFormat(surface);
1422 DisplayFormatAlpha ( surface )
1423 SDL_Surface *surface
1425 RETVAL = SDL_DisplayFormatAlpha(surface);
1430 ConvertRGB ( surface )
1431 SDL_Surface * surface
1433 SDL_PixelFormat fmt;
1435 fmt.BitsPerPixel = 24;
1436 fmt.BytesPerPixel = 3;
1437 fmt.Rmask = 0x000000ff;
1438 fmt.Gmask = 0x0000ff00;
1439 fmt.Bmask = 0x00ff0000;
1440 fmt.Amask = 0x00000000;
1451 RETVAL = SDL_ConvertSurface(surface,&fmt,surface->flags);
1456 ConvertRGBA ( surface )
1457 SDL_Surface * surface
1459 SDL_PixelFormat fmt;
1461 fmt.BitsPerPixel = 32;
1462 fmt.BytesPerPixel = 4;
1463 fmt.Rmask = 0x000000ff;
1464 fmt.Gmask = 0x0000ff00;
1465 fmt.Bmask = 0x00ff0000;
1466 fmt.Amask = 0xff000000;
1477 RETVAL = SDL_ConvertSurface(surface,&fmt,surface->flags);
1482 BlitSurface ( src, src_rect, dest, dest_rect )
1488 RETVAL = SDL_BlitSurface(src,src_rect,dest,dest_rect);
1493 FillRect ( dest, dest_rect, color )
1498 Uint32 pixel = SDL_MapRGB(dest->format,color->r,color->g,color->b);
1499 RETVAL = SDL_FillRect(dest,dest_rect,pixel);
1506 RETVAL = SDL_GetAppState();
1512 WMSetCaption ( title, icon )
1516 SDL_WM_SetCaption(title,icon);
1522 SDL_WM_GetCaption(&title,&icon);
1524 av_push(RETVAL,newSVpv(title,0));
1525 av_push(RETVAL,newSVpv(icon,0));
1533 SDL_WM_SetIcon(icon,NULL);
1548 mask = SDL_GetMouseState(&x,&y);
1550 av_push(RETVAL,newSViv(mask));
1551 av_push(RETVAL,newSViv(x));
1552 av_push(RETVAL,newSViv(y));
1557 GetRelativeMouseState ()
1562 mask = SDL_GetRelativeMouseState(&x,&y);
1564 av_push(RETVAL,newSViv(mask));
1565 av_push(RETVAL,newSViv(x));
1566 av_push(RETVAL,newSViv(y));
1571 NewCursor ( data, mask, x ,y )
1577 RETVAL = SDL_CreateCursor((Uint8*)data->pixels,
1578 (Uint8*)mask->pixels,data->w,data->h,x,y);
1583 FreeCursor ( cursor )
1586 SDL_FreeCursor(cursor);
1589 SetCursor ( cursor )
1592 SDL_SetCursor(cursor);
1597 RETVAL = SDL_GetCursor();
1602 ShowCursor ( toggle )
1605 RETVAL = SDL_ShowCursor(toggle);
1610 NewAudioSpec ( freq, format, channels, samples )
1616 RETVAL = (SDL_AudioSpec *)safemalloc(sizeof(SDL_AudioSpec));
1617 RETVAL->freq = freq;
1618 RETVAL->format = format;
1619 RETVAL->channels = channels;
1620 RETVAL->samples = samples;
1625 FreeAudioSpec ( spec )
1631 NewAudioCVT ( src_format, src_channels, src_rate, dst_format, dst_channels, dst_rate)
1639 RETVAL = (SDL_AudioCVT *)safemalloc(sizeof(SDL_AudioCVT));
1640 if (SDL_BuildAudioCVT(RETVAL,src_format, src_channels, src_rate,
1641 dst_format, dst_channels, dst_rate)) {
1642 safefree(RETVAL); RETVAL = NULL; }
1647 FreeAudioCVT ( cvt )
1653 ConvertAudioData ( cvt, data, len )
1659 cvt->buf = (Uint8*) safemalloc(cvt->len*cvt->len_mult);
1660 memcpy(cvt->buf,data,cvt->len);
1661 RETVAL = SDL_ConvertAudio(cvt);
1666 OpenAudio ( spec, callback )
1670 spec->userdata = (void*)callback;
1671 spec->callback = sdl_perl_audio_callback;
1672 RETVAL = SDL_OpenAudio(spec,NULL);
1679 RETVAL = SDL_GetAudioStatus ();
1687 SDL_PauseAudio(p_on);
1711 LoadWAV ( filename, spec )
1715 SDL_AudioSpec *temp;
1720 temp = SDL_LoadWAV(filename,spec,&buf,&len);
1721 if ( ! temp ) goto error;
1722 av_push(RETVAL,newSViv(PTR2IV(temp)));
1723 av_push(RETVAL,newSViv(PTR2IV(buf)));
1724 av_push(RETVAL,newSViv(len));
1729 #ifdef HAVE_SDL_MIXER
1732 MixAudio ( dst, src, len, volume )
1738 SDL_MixAudio(dst,src,len,volume);
1741 MixOpenAudio ( frequency, format, channels, chunksize )
1747 RETVAL = Mix_OpenAudio(frequency, format, channels, chunksize);
1752 MixAllocateChannels ( number )
1755 RETVAL = Mix_AllocateChannels(number);
1762 int freq, channels, status;
1764 status = Mix_QuerySpec(&freq,&format,&channels);
1766 av_push(RETVAL,newSViv(status));
1767 av_push(RETVAL,newSViv(freq));
1768 av_push(RETVAL,newSViv(format));
1769 av_push(RETVAL,newSViv(channels));
1774 MixLoadWAV ( filename )
1777 RETVAL = Mix_LoadWAV(filename);
1782 MixLoadMusic ( filename )
1785 RETVAL = Mix_LoadMUS(filename);
1790 MixQuickLoadWAV ( buf )
1793 RETVAL = Mix_QuickLoad_WAV(buf);
1798 MixFreeChunk( chunk )
1801 Mix_FreeChunk(chunk);
1804 MixFreeMusic ( music )
1807 Mix_FreeMusic(music);
1810 MixSetPostMixCallback ( func, arg )
1814 Mix_SetPostMix(func,arg);
1819 RETVAL = sdl_perl_music_callback;
1824 MixSetMusicHook ( func, arg )
1828 Mix_HookMusic(func,arg);
1831 MixSetMusicFinishedHook ( func )
1834 mix_music_finished_cv = func;
1835 Mix_HookMusicFinished(sdl_perl_music_finished_callback);
1838 MixGetMusicHookData ()
1840 RETVAL = Mix_GetMusicHookData();
1845 MixReverseChannels ( number )
1848 RETVAL = Mix_ReserveChannels ( number );
1853 MixGroupChannel ( which, tag )
1857 RETVAL = Mix_GroupChannel(which,tag);
1862 MixGroupChannels ( from, to, tag )
1867 RETVAL = Mix_GroupChannels(from,to,tag);
1872 MixGroupAvailable ( tag )
1875 RETVAL = Mix_GroupAvailable(tag);
1880 MixGroupCount ( tag )
1883 RETVAL = Mix_GroupCount(tag);
1888 MixGroupOldest ( tag )
1891 RETVAL = Mix_GroupOldest(tag);
1896 MixGroupNewer ( tag )
1899 RETVAL = Mix_GroupNewer(tag);
1904 MixPlayChannel ( channel, chunk, loops )
1909 RETVAL = Mix_PlayChannel(channel,chunk,loops);
1914 MixPlayChannelTimed ( channel, chunk, loops, ticks )
1920 RETVAL = Mix_PlayChannelTimed(channel,chunk,loops,ticks);
1925 MixPlayMusic ( music, loops )
1929 RETVAL = Mix_PlayMusic(music,loops);
1934 MixFadeInChannel ( channel, chunk, loops, ms )
1940 RETVAL = Mix_FadeInChannel(channel,chunk,loops,ms);
1945 MixFadeInChannelTimed ( channel, chunk, loops, ms, ticks )
1952 RETVAL = Mix_FadeInChannelTimed(channel,chunk,loops,ms,ticks);
1957 MixFadeInMusic ( music, loops, ms )
1962 RETVAL = Mix_FadeInMusic(music,loops,ms);
1967 MixVolume ( channel, volume )
1971 RETVAL = Mix_Volume(channel,volume);
1976 MixVolumeChunk ( chunk, volume )
1980 RETVAL = Mix_VolumeChunk(chunk,volume);
1985 MixVolumeMusic ( volume )
1988 RETVAL = Mix_VolumeMusic(volume);
1993 MixHaltChannel ( channel )
1996 RETVAL = Mix_HaltChannel(channel);
2001 MixHaltGroup ( tag )
2004 RETVAL = Mix_HaltGroup(tag);
2011 RETVAL = Mix_HaltMusic();
2016 MixExpireChannel ( channel, ticks )
2020 RETVAL = Mix_ExpireChannel ( channel,ticks);
2025 MixFadeOutChannel ( which, ms )
2029 RETVAL = Mix_FadeOutChannel(which,ms);
2034 MixFadeOutGroup ( which, ms )
2038 RETVAL = Mix_FadeOutGroup(which,ms);
2043 MixFadeOutMusic ( ms )
2046 RETVAL = Mix_FadeOutMusic(ms);
2053 RETVAL = Mix_FadingMusic();
2058 MixFadingChannel( which )
2061 RETVAL = Mix_FadingChannel(which);
2066 MixPause ( channel )
2072 MixResume ( channel )
2075 Mix_Resume(channel);
2078 MixPaused ( channel )
2081 RETVAL = Mix_Paused(channel);
2103 RETVAL = Mix_PausedMusic();
2108 MixPlaying( channel )
2111 RETVAL = Mix_Playing(channel);
2118 RETVAL = Mix_PlayingMusic();
2131 GLLoadLibrary ( path )
2134 RETVAL = SDL_GL_LoadLibrary(path);
2139 GLGetProcAddress ( proc )
2142 RETVAL = SDL_GL_GetProcAddress(proc);
2147 GLSetAttribute ( attr, value )
2151 RETVAL = SDL_GL_SetAttribute(attr, value);
2156 GLGetAttribute ( attr )
2161 av_push(RETVAL,newSViv(SDL_GL_GetAttribute(attr, &value)));
2162 av_push(RETVAL,newSViv(value));
2169 SDL_GL_SwapBuffers ();
2175 RETVAL = (SDL_BYTEORDER == SDL_BIG_ENDIAN);
2182 RETVAL = SDL_NumJoysticks();
2187 JoystickName ( index )
2190 RETVAL = (char*)SDL_JoystickName(index);
2195 JoystickOpen ( index )
2198 RETVAL = SDL_JoystickOpen(index);
2203 JoystickOpened ( index )
2206 RETVAL = SDL_JoystickOpened(index);
2211 JoystickIndex ( joystick )
2212 SDL_Joystick *joystick
2214 RETVAL = SDL_JoystickIndex(joystick);
2219 JoystickNumAxes ( joystick )
2220 SDL_Joystick *joystick
2222 RETVAL = SDL_JoystickNumAxes(joystick);
2227 JoystickNumBalls ( joystick )
2228 SDL_Joystick *joystick
2230 RETVAL = SDL_JoystickNumBalls(joystick);
2235 JoystickNumHats ( joystick )
2236 SDL_Joystick *joystick
2238 RETVAL = SDL_JoystickNumHats(joystick);
2243 JoystickNumButtons ( joystick )
2244 SDL_Joystick *joystick
2246 RETVAL = SDL_JoystickNumButtons(joystick);
2253 SDL_JoystickUpdate();
2256 JoystickGetAxis ( joystick, axis )
2257 SDL_Joystick *joystick
2260 RETVAL = SDL_JoystickGetAxis(joystick,axis);
2265 JoystickGetHat ( joystick, hat )
2266 SDL_Joystick *joystick
2269 RETVAL = SDL_JoystickGetHat(joystick,hat);
2274 JoystickGetButton ( joystick, button)
2275 SDL_Joystick *joystick
2278 RETVAL = SDL_JoystickGetButton(joystick,button);
2283 JoystickGetBall ( joystick, ball )
2284 SDL_Joystick *joystick
2288 success = SDL_JoystickGetBall(joystick,ball,&dx,&dy);
2290 av_push(RETVAL,newSViv(success));
2291 av_push(RETVAL,newSViv(dx));
2292 av_push(RETVAL,newSViv(dy));
2297 JoystickClose ( joystick )
2298 SDL_Joystick *joystick
2300 SDL_JoystickClose(joystick);
2303 JoyAxisEventWhich ( e )
2306 RETVAL = e->jaxis.which;
2311 JoyAxisEventAxis ( e )
2314 RETVAL = e->jaxis.axis;
2319 JoyAxisEventValue ( e )
2322 RETVAL = e->jaxis.value;
2327 JoyButtonEventWhich ( e )
2330 RETVAL = e->jbutton.which;
2335 JoyButtonEventButton ( e )
2338 RETVAL = e->jbutton.button;
2343 JoyButtonEventState ( e )
2346 RETVAL = e->jbutton.state;
2351 JoyHatEventWhich ( e )
2354 RETVAL = e->jhat.which;
2359 JoyHatEventHat ( e )
2362 RETVAL = e->jhat.hat;
2367 JoyHatEventValue ( e )
2370 RETVAL = e->jhat.value;
2375 JoyBallEventWhich ( e )
2378 RETVAL = e->jball.which;
2383 JoyBallEventBall ( e )
2386 RETVAL = e->jball.ball;
2391 JoyBallEventXrel ( e )
2394 RETVAL = e->jball.xrel;
2399 JoyBallEventYrel ( e )
2402 RETVAL = e->jball.yrel;
2407 SetClipRect ( surface, rect )
2408 SDL_Surface *surface
2411 SDL_SetClipRect(surface,rect);
2414 GetClipRect ( surface )
2415 SDL_Surface *surface
2417 RETVAL = (SDL_Rect*) safemalloc(sizeof(SDL_Rect));
2418 SDL_GetClipRect(surface,RETVAL);
2428 RETVAL = SDLNet_Init();
2438 NetNewIPaddress ( host, port )
2442 RETVAL = (IPaddress*) safemalloc(sizeof(IPaddress));
2443 RETVAL->host = host;
2444 RETVAL->port = port;
2449 NetIPaddressHost ( ip )
2457 NetIPaddressPort ( ip )
2465 NetFreeIPaddress ( ip )
2471 NetResolveIP ( address )
2474 RETVAL = SDLNet_ResolveIP(address);
2479 NetResolveHost ( address, host, port )
2484 RETVAL = SDLNet_ResolveHost(address,host,port);
2492 RETVAL = SDLNet_TCP_Open(ip);
2497 NetTCPAccept ( server )
2500 RETVAL = SDLNet_TCP_Accept(server);
2505 NetTCPGetPeerAddress ( sock )
2508 RETVAL = SDLNet_TCP_GetPeerAddress(sock);
2513 NetTCPSend ( sock, data, len )
2518 RETVAL = SDLNet_TCP_Send(sock,data,len);
2523 NetTCPRecv ( sock, maxlen )
2529 buffer = safemalloc(maxlen);
2531 status = SDLNet_TCP_Recv(sock,buffer,maxlen);
2532 av_push(RETVAL,newSViv(status));
2533 av_push(RETVAL,newSVpvn((char*)buffer,maxlen));
2538 NetTCPClose ( sock )
2541 SDLNet_TCP_Close(sock);
2544 NetAllocPacket ( size )
2547 RETVAL = SDLNet_AllocPacket(size);
2552 NetAllocPacketV ( howmany, size )
2556 RETVAL = SDLNet_AllocPacketV(howmany,size);
2561 NetResizePacket ( packet, newsize )
2565 RETVAL = SDLNet_ResizePacket(packet,newsize);
2570 NetFreePacket ( packet )
2573 SDLNet_FreePacket(packet);
2576 NetFreePacketV ( packet )
2579 SDLNet_FreePacketV(packet);
2585 RETVAL = SDLNet_UDP_Open(port);
2590 NetUDPBind ( sock, channel, address )
2595 RETVAL = SDLNet_UDP_Bind(sock,channel,address);
2600 NetUDPUnbind ( sock, channel )
2604 SDLNet_UDP_Unbind(sock,channel);
2607 NetUDPGetPeerAddress ( sock, channel )
2611 RETVAL = SDLNet_UDP_GetPeerAddress(sock,channel);
2616 NetUDPSendV ( sock, packets, npackets )
2621 RETVAL = SDLNet_UDP_SendV(sock,packets,npackets);
2626 NetUDPSend ( sock, channel, packet )
2631 RETVAL = SDLNet_UDP_Send(sock,channel,packet);
2636 NetUDPRecvV ( sock, packets )
2640 RETVAL = SDLNet_UDP_RecvV(sock,packets);
2645 NetUDPRecv ( sock, packet )
2649 RETVAL = SDLNet_UDP_Recv(sock,packet);
2654 NetUDPClose ( sock )
2657 SDLNet_UDP_Close(sock);
2660 NetAllocSocketSet ( maxsockets )
2663 RETVAL = SDLNet_AllocSocketSet(maxsockets);
2668 NetTCP_AddSocket ( set, sock )
2669 SDLNet_SocketSet set
2672 RETVAL = SDLNet_TCP_AddSocket(set,sock);
2677 NetUDP_AddSocket ( set, sock )
2678 SDLNet_SocketSet set
2681 RETVAL = SDLNet_UDP_AddSocket(set,sock);
2686 NetTCP_DelSocket ( set, sock )
2687 SDLNet_SocketSet set
2690 RETVAL = SDLNet_TCP_DelSocket(set,sock);
2695 NetUDP_DelSocket ( set, sock )
2696 SDLNet_SocketSet set
2699 RETVAL = SDLNet_UDP_DelSocket(set,sock);
2704 NetCheckSockets ( set, timeout )
2705 SDLNet_SocketSet set
2708 RETVAL = SDLNet_CheckSockets(set,timeout);
2713 NetSocketReady ( sock )
2714 SDLNet_GenericSocket sock
2716 RETVAL = SDLNet_SocketReady(sock);
2721 NetFreeSocketSet ( set )
2722 SDLNet_SocketSet set
2724 SDLNet_FreeSocketSet(set);
2727 NetWrite16 ( value, area )
2731 SDLNet_Write16(value,area);
2734 NetWrite32 ( value, area )
2738 SDLNet_Write32(value,area);
2744 RETVAL = SDLNet_Read16(area);
2752 RETVAL = SDLNet_Read32(area);
2763 RETVAL = TTF_Init();
2773 TTFOpenFont ( file, ptsize )
2777 RETVAL = TTF_OpenFont(file,ptsize);
2782 TTFGetFontStyle ( font )
2785 RETVAL = TTF_GetFontStyle(font);
2790 TTFSetFontStyle ( font, style )
2794 TTF_SetFontStyle(font,style);
2797 TTFFontHeight ( font )
2800 RETVAL = TTF_FontHeight(font);
2805 TTFFontAscent ( font )
2808 RETVAL = TTF_FontAscent(font);
2813 TTFFontDescent ( font )
2816 RETVAL = TTF_FontDescent(font);
2821 TTFFontLineSkip ( font )
2824 RETVAL = TTF_FontLineSkip(font);
2829 TTFGlyphMetrics ( font, ch )
2833 int minx, miny, maxx, maxy, advance;
2835 TTF_GlyphMetrics(font, ch, &minx, &miny, &maxx, &maxy, &advance);
2836 av_push(RETVAL,newSViv(minx));
2837 av_push(RETVAL,newSViv(miny));
2838 av_push(RETVAL,newSViv(maxx));
2839 av_push(RETVAL,newSViv(maxy));
2840 av_push(RETVAL,newSViv(advance));
2845 TTFSizeText ( font, text )
2851 TTF_SizeText(font,text,&w,&h);
2852 av_push(RETVAL,newSViv(w));
2853 av_push(RETVAL,newSViv(h));
2858 TTFSizeUTF8 ( font, text )
2864 TTF_SizeUTF8(font,text,&w,&h);
2865 av_push(RETVAL,newSViv(w));
2866 av_push(RETVAL,newSViv(h));
2871 TTFSizeUNICODE ( font, text )
2877 TTF_SizeUNICODE(font,text,&w,&h);
2878 av_push(RETVAL,newSViv(w));
2879 av_push(RETVAL,newSViv(h));
2884 TTFRenderTextSolid ( font, text, fg )
2889 RETVAL = TTF_RenderText_Solid(font,text,*fg);
2894 TTFRenderUTF8Solid ( font, text, fg )
2899 RETVAL = TTF_RenderUTF8_Solid(font,text,*fg);
2904 TTFRenderUNICODESolid ( font, text, fg )
2909 RETVAL = TTF_RenderUNICODE_Solid(font,text,*fg);
2914 TTFRenderGlyphSolid ( font, ch, fg )
2919 RETVAL = TTF_RenderGlyph_Solid(font,ch,*fg);
2924 TTFRenderTextShaded ( font, text, fg, bg )
2930 RETVAL = TTF_RenderText_Shaded(font,text,*fg,*bg);
2935 TTFRenderUTF8Shaded( font, text, fg, bg )
2941 RETVAL = TTF_RenderUTF8_Shaded(font,text,*fg,*bg);
2946 TTFRenderUNICODEShaded( font, text, fg, bg )
2952 RETVAL = TTF_RenderUNICODE_Shaded(font,text,*fg,*bg);
2957 TTFRenderGlyphShaded ( font, ch, fg, bg )
2963 RETVAL = TTF_RenderGlyph_Shaded(font,ch,*fg,*bg);
2968 TTFRenderTextBlended( font, text, fg )
2973 RETVAL = TTF_RenderText_Blended(font,text,*fg);
2978 TTFRenderUTF8Blended( font, text, fg )
2983 RETVAL = TTF_RenderUTF8_Blended(font,text,*fg);
2988 TTFRenderUNICODEBlended( font, text, fg )
2993 RETVAL = TTF_RenderUNICODE_Blended(font,text,*fg);
2998 TTFRenderGlyphBlended( font, ch, fg )
3003 RETVAL = TTF_RenderGlyph_Blended(font,ch,*fg);
3008 TTFCloseFont ( font )
3011 TTF_CloseFont(font);
3014 TTFPutString ( font, mode, surface, x, y, fg, bg, text )
3017 SDL_Surface *surface
3032 img = TTF_RenderText_Solid(font,text,*fg);
3033 TTF_SizeText(font,text,&w,&h);
3038 img = TTF_RenderText_Shaded(font,text,*fg,*bg);
3039 TTF_SizeText(font,text,&w,&h);
3044 img = TTF_RenderText_Blended(font,text,*fg);
3045 TTF_SizeText(font,text,&w,&h);
3050 img = TTF_RenderUTF8_Solid(font,text,*fg);
3051 TTF_SizeUTF8(font,text,&w,&h);
3056 img = TTF_RenderUTF8_Shaded(font,text,*fg,*bg);
3057 TTF_SizeUTF8(font,text,&w,&h);
3062 img = TTF_RenderUTF8_Blended(font,text,*fg);
3063 TTF_SizeUTF8(font,text,&w,&h);
3068 img = TTF_RenderUNICODE_Solid(font,(Uint16*)text,*fg);
3069 TTF_SizeUNICODE(font,(Uint16*)text,&w,&h);
3073 case UNICODE_SHADED:
3074 img = TTF_RenderUNICODE_Shaded(font,(Uint16*)text,*fg,*bg);
3075 TTF_SizeUNICODE(font,(Uint16*)text,&w,&h);
3079 case UNICODE_BLENDED:
3080 img = TTF_RenderUNICODE_Blended(font,(Uint16*)text,*fg);
3081 TTF_SizeUNICODE(font,(Uint16*)text,&w,&h);
3086 img = TTF_RenderText_Shaded(font,text,*fg,*bg);
3087 TTF_SizeText(font,text,&w,&h);
3091 if ( img && img->format && img->format->palette ) {
3092 SDL_Color *c = &img->format->palette->colors[0];
3093 Uint32 key = SDL_MapRGB( img->format, c->r, c->g, c->b );
3094 SDL_SetColorKey(img,SDL_SRCCOLORKEY,key );
3095 if (0 > SDL_BlitSurface(img,NULL,surface,&dest)) {
3096 SDL_FreeSurface(img);
3108 CreateYUVOverlay ( width, height, format, display )
3112 SDL_Surface *display
3114 RETVAL = SDL_CreateYUVOverlay ( width, height, format, display );
3119 LockYUVOverlay ( overlay )
3120 SDL_Overlay *overlay
3122 RETVAL = SDL_LockYUVOverlay(overlay);
3127 UnlockYUVOverlay ( overlay )
3128 SDL_Overlay *overlay
3130 SDL_UnlockYUVOverlay(overlay);
3133 DisplayYUVOverlay ( overlay, dstrect )
3134 SDL_Overlay *overlay
3137 RETVAL = SDL_DisplayYUVOverlay ( overlay, dstrect );
3142 FreeYUVOverlay ( overlay )
3143 SDL_Overlay *overlay
3145 SDL_FreeYUVOverlay ( overlay );
3148 OverlayFormat ( overlay, ... )
3149 SDL_Overlay *overlay
3152 overlay->format = SvIV(ST(1));
3153 RETVAL = overlay->format;
3158 OverlayW ( overlay, ... )
3159 SDL_Overlay *overlay
3162 overlay->w = SvIV(ST(1));
3163 RETVAL = overlay->w;
3168 OverlayH ( overlay, ... )
3169 SDL_Overlay *overlay
3172 overlay->h = SvIV(ST(1));
3173 RETVAL = overlay->h;
3178 OverlayPlanes ( overlay, ... )
3179 SDL_Overlay *overlay
3182 overlay->planes = SvIV(ST(1));
3183 RETVAL = overlay->planes;
3188 OverlayHW ( overlay )
3189 SDL_Overlay *overlay
3191 RETVAL = overlay->hw_overlay;
3196 OverlayPitches ( overlay )
3197 SDL_Overlay *overlay
3199 RETVAL = overlay->pitches;
3204 OverlayPixels ( overlay )
3205 SDL_Overlay *overlay
3207 RETVAL = overlay->pixels;
3212 WMToggleFullScreen ( surface )
3213 SDL_Surface *surface
3215 RETVAL = SDL_WM_ToggleFullScreen(surface);
3220 WMGrabInput ( mode )
3223 RETVAL = SDL_WM_GrabInput(mode);
3230 RETVAL = SDL_WM_IconifyWindow();
3238 RETVAL = e->resize.w;
3246 RETVAL = e->resize.h;
3254 RETVAL = SDL_AudioDriverName(name,32);
3262 if (k >= SDLK_LAST) Perl_croak (aTHX_ "Key out of range");
3263 RETVAL = SDL_GetKeyState(NULL)[k];
3272 RETVAL = (SMPEG_Info *) safemalloc (sizeof(SMPEG_Info));
3277 FreeSMPEGInfo ( info )
3283 SMPEGInfoHasAudio ( info )
3286 RETVAL = info->has_audio;
3291 SMPEGInfoHasVideo ( info )
3294 RETVAL = info->has_video;
3299 SMPEGInfoWidth ( info )
3302 RETVAL = info->width;
3307 SMPEGInfoHeight ( info )
3310 RETVAL = info->height;
3315 SMPEGInfoCurrentFrame ( info )
3318 RETVAL = info->current_frame;
3323 SMPEGInfoCurrentFPS ( info )
3326 RETVAL = info->current_fps;
3331 SMPEGInfoCurrentAudioFrame ( info )
3334 RETVAL = info->audio_current_frame;
3339 SMPEGInfoCurrentOffset ( info )
3342 RETVAL = info->current_offset;
3347 SMPEGInfoTotalSize ( info )
3350 RETVAL = info->total_size;
3355 SMPEGInfoCurrentTime ( info )
3358 RETVAL = info->current_time;
3363 SMPEGInfoTotalTime ( info )
3366 RETVAL = info->total_time;
3374 RETVAL = SMPEG_error(mpeg);
3379 NewSMPEG ( filename, info, use_audio )
3384 #ifdef HAVE_SDL_MIXER
3385 RETVAL = SMPEG_new(filename,info,0);
3387 RETVAL = SMPEG_new(filename,info,use_audio);
3399 SMPEGEnableAudio ( mpeg , flag )
3403 SMPEG_enableaudio(mpeg,flag);
3404 #ifdef HAVE_SDL_MIXER
3405 sdl_perl_use_smpeg_audio = flag;
3409 SMPEGEnableVideo ( mpeg , flag )
3413 SMPEG_enablevideo(mpeg,flag);
3416 SMPEGSetVolume ( mpeg , volume )
3420 SMPEG_setvolume(mpeg,volume);
3423 SMPEGSetDisplay ( mpeg, dest, surfLock )
3426 SDL_mutex* surfLock;
3428 SMPEG_setdisplay(mpeg,dest,surfLock,NULL);
3431 SMPEGScaleXY ( mpeg, w, h)
3436 SMPEG_scaleXY(mpeg,w,h);
3439 SMPEGScale ( mpeg, scale )
3443 SMPEG_scale(mpeg,scale);
3449 SDL_AudioSpec audiofmt;
3452 #ifdef HAVE_SDL_MIXER
3453 if (sdl_perl_use_smpeg_audio ) {
3454 SMPEG_enableaudio(mpeg, 0);
3455 Mix_QuerySpec(&freq, &format, &channels);
3456 audiofmt.format = format;
3457 audiofmt.freq = freq;
3458 audiofmt.channels = channels;
3459 SMPEG_actualSpec(mpeg, &audiofmt);
3460 Mix_HookMusic(SMPEG_playAudioSDL, mpeg);
3461 SMPEG_enableaudio(mpeg, 1);
3467 SMPEGStatus ( mpeg )
3470 RETVAL = SMPEG_status(mpeg);
3481 SMPEGLoop ( mpeg, repeat )
3485 SMPEG_loop(mpeg,repeat);
3492 #ifdef HAVE_SDL_MIXER
3493 Mix_HookMusic(NULL, NULL);
3497 SMPEGRewind ( mpeg )
3503 SMPEGSeek ( mpeg, bytes )
3507 SMPEG_seek(mpeg,bytes);
3510 SMPEGSkip ( mpeg, seconds )
3514 SMPEG_skip(mpeg,seconds);
3517 SMPEGSetDisplayRegion ( mpeg, rect )
3521 SMPEG_setdisplayregion(mpeg,rect->x,rect->y,rect->w,rect->h);
3524 SMPEGRenderFrame ( mpeg, frame )
3528 SMPEG_renderFrame(mpeg,frame);
3531 SMPEGGetInfo ( mpeg )
3534 RETVAL = (SMPEG_Info *) safemalloc (sizeof(SMPEG_Info));
3535 SMPEG_getinfo(mpeg,RETVAL);
3545 GFXRotoZoom ( src, angle, zoom, smooth)
3551 RETVAL = rotozoomSurface( src, angle, zoom, smooth);
3556 GFXZoom ( src, zoomx, zoomy, smooth)
3562 RETVAL = zoomSurface( src, zoomx, zoomy, smooth);
3568 GFXPixelColor ( dst, x, y, color )
3574 RETVAL = pixelColor( dst, x, y, color);
3579 GFXPixelRGBA ( dst, x, y, r, g, b, a )
3588 RETVAL = pixelRGBA( dst, x, y, r, g, b, a );
3593 GFXHlineColor ( dst, x1, x2, y, color )
3600 RETVAL = hlineColor( dst, x1, x2, y, color );
3605 GFXHlineRGBA ( dst, x1, x2, y, r, g, b, a )
3615 RETVAL = hlineRGBA( dst, x1, x2, y, r, g, b, a );
3620 GFXVlineColor ( dst, x, y1, y2, color )
3627 RETVAL = vlineColor( dst, x, y1, y2, color );
3632 GFXVlineRGBA ( dst, x, y1, y2, r, g, b, a )
3642 RETVAL = vlineRGBA( dst, x, y1, y2, r, g, b, a );
3647 GFXRectangleColor ( dst, x1, y1, x2, y2, color )
3655 RETVAL = rectangleColor( dst, x1, y1, x2, y2, color );
3660 GFXRectangleRGBA ( dst, x1, y1, x2, y2, r, g, b, a )
3671 RETVAL = rectangleRGBA( dst, x1, y1, x2, y2, r, g, b, a );
3676 GFXBoxColor ( dst, x1, y1, x2, y2, color )
3684 RETVAL = boxColor( dst, x1, y1, x2, y2, color );
3689 GFXBoxRGBA ( dst, x1, y1, x2, y2, r, g, b, a )
3700 RETVAL = boxRGBA( dst, x1, y1, x2, y2, r, g, b, a );
3705 GFXLineColor ( dst, x1, y1, x2, y2, color )
3713 RETVAL = lineColor( dst, x1, y1, x2, y2, color );
3718 GFXLineRGBA ( dst, x1, y1, x2, y2, r, g, b, a )
3729 RETVAL = lineRGBA( dst, x1, y1, x2, y2, r, g, b, a );
3734 GFXAalineColor ( dst, x1, y1, x2, y2, color )
3742 RETVAL = aalineColor( dst, x1, y1, x2, y2, color );
3747 GFXAalineRGBA ( dst, x1, y1, x2, y2, r, g, b, a )
3758 RETVAL = aalineRGBA( dst, x1, y1, x2, y2, r, g, b, a );
3763 GFXCircleColor ( dst, x, y, r, color )
3770 RETVAL = circleColor( dst, x, y, r, color );
3775 GFXCircleRGBA ( dst, x, y, rad, r, g, b, a )
3785 RETVAL = circleRGBA( dst, x, y, rad, r, g, b, a );
3790 GFXAacircleColor ( dst, x, y, r, color )
3797 RETVAL = aacircleColor( dst, x, y, r, color );
3802 GFXAacircleRGBA ( dst, x, y, rad, r, g, b, a )
3812 RETVAL = aacircleRGBA( dst, x, y, rad, r, g, b, a );
3817 GFXFilledCircleColor ( dst, x, y, r, color )
3824 RETVAL = filledCircleColor( dst, x, y, r, color );
3829 GFXFilledCircleRGBA ( dst, x, y, rad, r, g, b, a )
3839 RETVAL = filledCircleRGBA( dst, x, y, rad, r, g, b, a );
3844 GFXEllipseColor ( dst, x, y, rx, ry, color )
3852 RETVAL = ellipseColor( dst, x, y, rx, ry, color );
3857 GFXEllipseRGBA ( dst, x, y, rx, ry, r, g, b, a )
3868 RETVAL = ellipseRGBA( dst, x, y, rx, ry, r, g, b, a );
3873 GFXAaellipseColor ( dst, xc, yc, rx, ry, color )
3881 RETVAL = aaellipseColor( dst, xc, yc, rx, ry, color );
3886 GFXAaellipseRGBA ( dst, x, y, rx, ry, r, g, b, a )
3897 RETVAL = aaellipseRGBA( dst, x, y, rx, ry, r, g, b, a );
3902 GFXFilledEllipseColor ( dst, x, y, rx, ry, color )
3910 RETVAL = filledEllipseColor( dst, x, y, rx, ry, color );
3915 GFXFilledEllipseRGBA ( dst, x, y, rx, ry, r, g, b, a )
3926 RETVAL = filledEllipseRGBA( dst, x, y, rx, ry, r, g, b, a );
3931 GFXFilledPieColor ( dst, x, y, rad, start, end, color )
3940 RETVAL = filledPieColor( dst, x, y, rad, start, end, color );
3945 GFXFilledPieRGBA ( dst, x, y, rad, start, end, r, g, b, a )
3957 RETVAL = filledPieRGBA( dst, x, y, rad, start, end, r, g, b, a );
3962 GFXPolygonColor ( dst, vx, vy, n, color )
3969 RETVAL = polygonColor( dst, vx, vy, n, color );
3974 GFXPolygonRGBA ( dst, vx, vy, n, r, g, b, a )
3984 RETVAL = polygonRGBA( dst, vx, vy, n, r, g, b, a );
3989 GFXAapolygonColor ( dst, vx, vy, n, color )
3996 RETVAL = aapolygonColor( dst, vx, vy, n, color );
4001 GFXAapolygonRGBA ( dst, vx, vy, n, r, g, b, a )
4011 RETVAL = aapolygonRGBA( dst, vx, vy, n, r, g, b, a );
4016 GFXFilledPolygonColor ( dst, vx, vy, n, color )
4023 RETVAL = filledPolygonColor( dst, vx, vy, n, color );
4028 GFXFilledPolygonRGBA ( dst, vx, vy, n, r, g, b, a )
4038 RETVAL = filledPolygonRGBA( dst, vx, vy, n, r, g, b, a );
4043 GFXCharacterColor ( dst, x, y, c, color )
4050 RETVAL = characterColor( dst, x, y, c, color );
4055 GFXCharacterRGBA ( dst, x, y, c, r, g, b, a )
4065 RETVAL = characterRGBA( dst, x, y, c, r, g, b, a );
4070 GFXStringColor ( dst, x, y, c, color )
4077 RETVAL = stringColor( dst, x, y, c, color );
4082 GFXStringRGBA ( dst, x, y, c, r, g, b, a )
4092 RETVAL = stringRGBA( dst, x, y, c, r, g, b, a );
4098 #ifdef HAVE_SDL_SOUND
4101 SoundAudioInfoFormat ( audioinfo )
4102 Sound_AudioInfo* audioinfo
4104 RETVAL = audioinfo->format;
4109 SoundAudioInfoChannels ( audioinfo )
4110 Sound_AudioInfo* audioinfo
4112 RETVAL = audioinfo->channels;
4117 SoundAudioInforate ( audioinfo )
4118 Sound_AudioInfo* audioinfo
4120 RETVAL = audioinfo->rate;
4125 SoundDecoderInfoExtensions ( decoderinfo )
4126 Sound_DecoderInfo* decoderinfo
4129 for ( ext = decoderinfo->extensions; *ext != NULL; ext++ ){
4130 av_push(RETVAL,sv_2mortal(newSVpv(*ext,0)));
4136 SoundDecoderInfoDescription ( decoderinfo )
4137 Sound_DecoderInfo* decoderinfo
4139 RETVAL = decoderinfo->description;
4144 SoundDecoderInfoAuthor ( decoderinfo )
4145 Sound_DecoderInfo* decoderinfo
4147 RETVAL = decoderinfo->author;
4152 SoundDecoderInfoUrl ( decoderinfo )
4153 Sound_DecoderInfo* decoderinfo
4155 RETVAL = decoderinfo->url;
4159 const Sound_DecoderInfo*
4160 SoundSampleDecoder ( sample )
4161 Sound_Sample* sample
4163 RETVAL = sample->decoder;
4168 SoundSampleDesired ( sample )
4169 Sound_Sample* sample
4171 RETVAL = &sample->desired;
4176 SoundSampleAcutal ( sample )
4177 Sound_Sample* sample
4179 RETVAL = &sample->actual;
4184 SoundSampleBuffer ( sample )
4185 Sound_Sample* sample
4187 RETVAL = sample->buffer;
4192 SoundSampleBufferSize ( sample )
4193 Sound_Sample* sample
4195 RETVAL = sample->buffer;
4200 SoundSampleFlags ( sample )
4201 Sound_Sample* sample
4203 RETVAL = (Uint32)sample->flags;
4211 MODULE = SDL PACKAGE = SDL
4212 PROTOTYPES : DISABLE