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 sdl_perl_timer_callback ( Uint32 interval, void* param )
88 XPUSHs(sv_2mortal(newSViv(interval)));
91 if (0 != (back = call_sv(cmd,G_SCALAR))) {
93 if (back != 1 ) Perl_croak (aTHX_ "Timer Callback failed!");
96 Perl_croak(aTHX_ "Timer Callback failed!");
108 sdl_perl_audio_callback ( void* data, Uint8 *stream, int len )
119 XPUSHs(sv_2mortal(newSViv(PTR2IV(stream))));
120 XPUSHs(sv_2mortal(newSViv(len)));
123 call_sv(cmd,G_VOID|G_DISCARD);
132 #ifdef HAVE_SDL_MIXER
135 sdl_perl_music_callback ( void )
141 cmd = (SV*)Mix_GetMusicHookData();
148 call_sv(cmd,G_VOID|G_DISCARD);
158 sdl_perl_music_finished_callback ( void )
164 cmd = (SV*)mix_music_finished_cv;
165 if ( cmd == NULL ) return;
172 call_sv(cmd,G_VOID|G_DISCARD);
184 sdl_perl_atexit (void)
193 void boot_SDL__OpenGL();
201 MODULE = SDL_perl PACKAGE = SDL
207 RETVAL = SDL_GetError();
218 RETVAL = SDL_Init(flags);
219 #ifdef HAVE_TLS_CONTEXT
220 Perl_call_atexit(PERL_GET_CONTEXT, (void*)sdl_perl_atexit,0);
222 atexit(sdl_perl_atexit);
228 InitSubSystem ( flags )
231 RETVAL = SDL_InitSubSystem(flags);
236 QuitSubSystem ( flags )
239 SDL_QuitSubSystem(flags);
254 RETVAL = SDL_WasInit(flags);
267 RETVAL = SDL_GetTicks();
272 SetTimer ( interval, callback )
274 SDL_TimerCallback callback
276 RETVAL = SDL_SetTimer(interval,callback);
281 AddTimer ( interval, callback, param )
283 SDL_NewTimerCallback callback
286 RETVAL = SDL_AddTimer(interval,callback,param);
293 RETVAL = sdl_perl_timer_callback;
298 NewTimer ( interval, cmd )
302 RETVAL = SDL_AddTimer(interval,sdl_perl_timer_callback,cmd);
310 RETVAL = SDL_RemoveTimer(id);
317 RETVAL = SDL_CDNumDrives();
325 RETVAL = strdup(SDL_CDName(drive));
333 RETVAL = SDL_CDOpen(drive);
346 CDTrackType ( track )
349 RETVAL = track->type;
354 CDTrackLength ( track )
357 RETVAL = track->length;
362 CDTrackOffset ( track )
365 RETVAL = track->offset;
373 RETVAL = SDL_CDStatus(cd);
378 CDPlayTracks ( cd, start_track, ntracks, start_frame, nframes )
385 RETVAL = SDL_CDPlayTracks(cd,start_track,start_frame,ntracks,nframes);
390 CDPlay ( cd, start, length )
395 RETVAL = SDL_CDPlay(cd,start,length);
403 RETVAL = SDL_CDPause(cd);
411 RETVAL = SDL_CDResume(cd);
419 RETVAL = SDL_CDStop(cd);
427 RETVAL = SDL_CDEject(cd);
449 RETVAL = cd->numtracks;
457 RETVAL = cd->cur_track;
465 RETVAL = cd->cur_frame;
470 CDTrack ( cd, number )
474 RETVAL = (SDL_CDtrack *)(cd->track + number);
487 RETVAL = SDL_PushEvent( e );
494 RETVAL = (SDL_Event *) safemalloc (sizeof(SDL_Event));
508 RETVAL = SDL_PollEvent(e);
516 RETVAL = SDL_WaitEvent(e);
521 EventState ( type, state )
525 RETVAL = SDL_EventState(type,state);
538 SetEventType ( e, type )
548 ActiveEventGain ( e )
551 RETVAL = e->active.gain;
556 ActiveEventState ( e )
559 RETVAL = e->active.state;
567 RETVAL = e->key.state;
575 RETVAL = e->key.keysym.sym;
583 RETVAL = e->key.keysym.mod;
588 KeyEventUnicode ( e )
591 RETVAL = e->key.keysym.unicode;
596 KeyEventScanCode ( e )
599 RETVAL = e->key.keysym.scancode;
604 MouseMotionState ( e )
607 RETVAL = e->motion.state;
615 RETVAL = e->motion.x;
623 RETVAL = e->motion.y;
631 RETVAL = e->motion.xrel;
636 MouseMotionYrel ( e )
639 RETVAL = e->motion.yrel;
644 MouseButtonState ( e )
647 RETVAL = e->button.state;
655 RETVAL = e->button.button;
663 RETVAL = e->button.x;
671 RETVAL = e->button.y;
679 RETVAL = e->syswm.msg;
684 EnableUnicode ( enable )
687 RETVAL = SDL_EnableUNICODE(enable);
692 EnableKeyRepeat ( delay, interval )
696 SDL_EnableKeyRepeat(delay,interval);
701 RETVAL = SDL_GetModState();
706 SetModState ( state )
709 SDL_SetModState(state);
715 RETVAL = SDL_GetKeyName(sym);
720 CreateRGBSurface (flags, width, height, depth, Rmask, Gmask, Bmask, Amask )
730 RETVAL = SDL_CreateRGBSurface ( flags, width, height,
731 depth, Rmask, Gmask, Bmask, Amask );
737 CreateRGBSurfaceFrom (pixels, width, height, depth, pitch, Rmask, Gmask, Bmask, Amask )
749 Uint32 len = pitch * height;
750 New(0,pixeldata,len,Uint8);
751 Copy(pixels,pixeldata,len,Uint8);
752 RETVAL = SDL_CreateRGBSurfaceFrom ( pixeldata, width, height,
753 depth, pitch, Rmask, Gmask, Bmask, Amask );
757 #ifdef HAVE_SDL_IMAGE
763 RETVAL = IMG_Load(fname);
770 SurfaceCopy ( surface )
774 Uint32 size = surface->pitch * surface->h;
775 New(0,pixels,size,Uint8);
776 Copy(surface->pixels,pixels,size,Uint8);
777 RETVAL = SDL_CreateRGBSurfaceFrom(pixels,surface->w,surface->h,
778 surface->format->BitsPerPixel, surface->pitch,
779 surface->format->Rmask, surface->format->Gmask,
780 surface->format->Bmask, surface->format->Amask);
785 FreeSurface ( surface )
789 Uint8* pixels = surface->pixels;
790 Uint32 flags = surface->flags;
791 SDL_FreeSurface(surface);
792 if (flags & SDL_PREALLOC)
797 SurfaceFlags ( surface )
800 RETVAL = surface->flags;
805 SurfacePalette ( surface )
808 RETVAL = surface->format->palette;
813 SurfaceBitsPerPixel ( surface )
816 RETVAL = surface->format->BitsPerPixel;
821 SurfaceBytesPerPixel ( surface )
824 RETVAL = surface->format->BytesPerPixel;
829 SurfaceRshift ( surface )
832 RETVAL = surface->format->Rshift;
837 SurfaceGshift ( surface )
840 RETVAL = surface->format->Gshift;
845 SurfaceBshift ( surface )
848 RETVAL = surface->format->Bshift;
853 SurfaceAshift ( surface )
856 RETVAL = surface->format->Ashift;
861 SurfaceRmask( surface )
864 RETVAL = surface->format->Rmask;
869 SurfaceGmask ( surface )
872 RETVAL = surface->format->Gmask;
877 SurfaceBmask ( surface )
880 RETVAL = surface->format->Bmask;
885 SurfaceAmask ( surface )
888 RETVAL = surface->format->Amask;
893 SurfaceColorKey ( surface )
896 RETVAL = surface->format->colorkey;
901 SurfaceAlpha( surface )
904 RETVAL = surface->format->alpha;
925 SurfacePitch ( surface )
928 RETVAL = surface->pitch;
933 SurfacePixels ( surface )
936 RETVAL = newSVpvn(surface->pixels,surface->pitch*surface->h);
941 SurfacePixel ( surface, x, y, ... )
949 int bpp = surface->format->BytesPerPixel;
950 Uint8* p = (Uint8*)surface->pixels + bpp*x + surface->pitch*y;
951 if ( items < 3 || items > 4 )
952 Perl_croak(aTHX_ "usage: SDL::SurfacePixel(surface,x,y,[color])");
954 color = (SDL_Color*)SvIV(ST(3));
955 pix = SDL_MapRGB(surface->format,color->r,color->g,color->b);
964 if (SDL_BYTEORDER == SDL_BIG_ENDIAN) {
965 p[0] = (pix >> 16) & 0xff;
966 p[1] = (pix >> 8) & 0xff;
970 p[1] = (pix >> 8) & 0xff;
971 p[2] = (pix >> 16) & 0xff;
979 RETVAL = (SDL_Color *) safemalloc(sizeof(SDL_Color));
983 memcpy(RETVAL,&surface->format->palette[index],sizeof(SDL_Color));
987 SDL_GetRGB(pix,surface->format,&r,&g,&b);
995 SDL_GetRGB(pix,surface->format,&r,&g,&b);
1005 MUSTLOCK ( surface )
1006 SDL_Surface *surface
1008 RETVAL = SDL_MUSTLOCK(surface);
1013 SurfaceLock ( surface )
1014 SDL_Surface *surface
1016 RETVAL = SDL_LockSurface(surface);
1021 SurfaceUnlock ( surface )
1022 SDL_Surface *surface
1024 SDL_UnlockSurface(surface);
1029 RETVAL = SDL_GetVideoSurface();
1038 SDL_VideoInfo *info;
1039 info = (SDL_VideoInfo *) safemalloc ( sizeof(SDL_VideoInfo));
1040 memcpy(info,SDL_GetVideoInfo(),sizeof(SDL_VideoInfo));
1042 hv_store(hv,"hw_available",strlen("hw_available"),
1043 newSViv(info->hw_available),0);
1044 hv_store(hv,"wm_available",strlen("wm_available"),
1045 newSViv(info->wm_available),0);
1046 hv_store(hv,"blit_hw",strlen("blit_hw"),
1047 newSViv(info->blit_hw),0);
1048 hv_store(hv,"blit_hw_CC",strlen("blit_hw_CC"),
1049 newSViv(info->blit_hw_CC),0);
1050 hv_store(hv,"blit_hw_A",strlen("blit_hw_A"),
1051 newSViv(info->blit_hw_A),0);
1052 hv_store(hv,"blit_sw",strlen("blit_sw"),
1053 newSViv(info->blit_sw),0);
1054 hv_store(hv,"blit_sw_CC",strlen("blit_sw_CC"),
1055 newSViv(info->blit_sw_CC),0);
1056 hv_store(hv,"blit_sw_A",strlen("blit_sw_A"),
1057 newSViv(info->blit_sw_A),0);
1058 hv_store(hv,"blit_fill",strlen("blit_fill"),
1059 newSViv(info->blit_fill),0);
1060 hv_store(hv,"video_mem",strlen("video_mem"),
1061 newSViv(info->video_mem),0);
1067 NewRect ( x, y, w, h )
1073 RETVAL = (SDL_Rect *) safemalloc (sizeof(SDL_Rect));
1091 if (items > 1 ) rect->x = SvIV(ST(1));
1100 if (items > 1 ) rect->y = SvIV(ST(1));
1109 if (items > 1 ) rect->w = SvIV(ST(1));
1118 if (items > 1 ) rect->h = SvIV(ST(1));
1124 ListModes ( format, flags )
1126 SDL_PixelFormat *format
1130 mode = SDL_ListModes(format,flags);
1131 if (mode == (SDL_Rect**)-1 ) {
1132 av_push(RETVAL,newSVpv("all",0));
1133 } else if (! mode ) {
1134 av_push(RETVAL,newSVpv("none",0));
1136 for (;*mode;mode++) {
1137 av_push(RETVAL,newSViv(PTR2IV(*mode)));
1145 NewColor ( r, g, b )
1150 RETVAL = (SDL_Color *) safemalloc(sizeof(SDL_Color));
1158 ColorR ( color, ... )
1161 if (items > 1 ) color->r = SvIV(ST(1));
1167 ColorG ( color, ... )
1170 if (items > 1 ) color->g = SvIV(ST(1));
1176 ColorB ( color, ... )
1179 if (items > 1 ) color->b = SvIV(ST(1));
1188 return; safefree(color);
1191 NewPalette ( number )
1194 RETVAL = (SDL_Palette *)safemalloc(sizeof(SDL_Palette));
1195 RETVAL->colors = (SDL_Color *)safemalloc(number *
1197 RETVAL->ncolors = number;
1202 PaletteNColors ( palette, ... )
1203 SDL_Palette *palette
1205 if ( items > 1 ) palette->ncolors = SvIV(ST(1));
1206 RETVAL = palette->ncolors;
1211 PaletteColors ( palette, index, ... )
1212 SDL_Palette *palette
1216 palette->colors[index].r = SvUV(ST(2));
1217 palette->colors[index].g = SvUV(ST(3));
1218 palette->colors[index].b = SvUV(ST(4));
1220 RETVAL = (SDL_Color *)(palette->colors + index);
1225 VideoModeOK ( width, height, bpp, flags )
1231 RETVAL = SDL_VideoModeOK(width,height,bpp,flags);
1236 SetVideoMode ( width, height, bpp, flags )
1242 RETVAL = SDL_SetVideoMode(width,height,bpp,flags);
1247 UpdateRect ( surface, x, y, w ,h )
1248 SDL_Surface *surface
1254 SDL_UpdateRect(surface,x,y,w,h);
1257 UpdateRects ( surface, ... )
1258 SDL_Surface *surface
1260 SDL_Rect *rects, *temp;
1262 if ( items < 2 ) return;
1263 num_rects = items - 1;
1264 rects = (SDL_Rect *)safemalloc(sizeof(SDL_Rect)*items);
1265 for(i=0;i<num_rects;i++) {
1266 temp = (SDL_Rect *)SvIV(ST(i+1));
1267 rects[i].x = temp->x;
1268 rects[i].y = temp->y;
1269 rects[i].w = temp->w;
1270 rects[i].h = temp->h;
1272 SDL_UpdateRects(surface,num_rects,rects);
1277 SDL_Surface *surface
1279 RETVAL = SDL_Flip(surface);
1284 SetColors ( surface, start, ... )
1285 SDL_Surface *surface
1288 SDL_Color *colors,*temp;
1290 if ( items < 3 ) { RETVAL = 0; goto all_done; }
1292 colors = (SDL_Color *)safemalloc(sizeof(SDL_Color)*(length+1));
1293 for ( i = 0; i < length ; i++ ) {
1294 temp = (SDL_Color *)SvIV(ST(i+2));
1295 colors[i].r = temp->r;
1296 colors[i].g = temp->g;
1297 colors[i].b = temp->b;
1299 RETVAL = SDL_SetColors(surface, colors, start, length );
1306 MapRGB ( surface, r, g, b )
1307 SDL_Surface *surface
1312 RETVAL = SDL_MapRGB(surface->format,r,g,b);
1317 MapRGBA ( surface, r, g, b, a )
1318 SDL_Surface *surface
1324 RETVAL = SDL_MapRGBA(surface->format,r,g,b,a);
1329 GetRGB ( surface, pixel )
1330 SDL_Surface *surface
1334 SDL_GetRGB(pixel,surface->format,&r,&g,&b);
1336 av_push(RETVAL,newSViv(r));
1337 av_push(RETVAL,newSViv(g));
1338 av_push(RETVAL,newSViv(b));
1343 GetRGBA ( surface, pixel )
1344 SDL_Surface *surface
1348 SDL_GetRGBA(pixel,surface->format,&r,&g,&b,&a);
1350 av_push(RETVAL,newSViv(r));
1351 av_push(RETVAL,newSViv(g));
1352 av_push(RETVAL,newSViv(b));
1353 av_push(RETVAL,newSViv(a));
1358 SaveBMP ( surface, filename )
1359 SDL_Surface *surface
1362 RETVAL = SDL_SaveBMP(surface,filename);
1367 SetColorKey ( surface, flag, key )
1368 SDL_Surface *surface
1372 Uint32 pixel = SDL_MapRGB(surface->format,key->r,key->g,key->b);
1373 RETVAL = SDL_SetColorKey(surface,flag,pixel);
1378 SetAlpha ( surface, flag, alpha )
1379 SDL_Surface *surface
1383 RETVAL = SDL_SetAlpha(surface,flag,alpha);
1388 DisplayFormat ( surface )
1389 SDL_Surface *surface
1391 RETVAL = SDL_DisplayFormat(surface);
1396 DisplayFormatAlpha ( surface )
1397 SDL_Surface *surface
1399 RETVAL = SDL_DisplayFormatAlpha(surface);
1404 ConvertRGB ( surface )
1405 SDL_Surface * surface
1407 SDL_PixelFormat fmt;
1409 fmt.BitsPerPixel = 24;
1410 fmt.BytesPerPixel = 3;
1411 fmt.Rmask = 0x000000ff;
1412 fmt.Gmask = 0x0000ff00;
1413 fmt.Bmask = 0x00ff0000;
1414 fmt.Amask = 0x00000000;
1425 RETVAL = SDL_ConvertSurface(surface,&fmt,surface->flags);
1430 ConvertRGBA ( surface )
1431 SDL_Surface * surface
1433 SDL_PixelFormat fmt;
1435 fmt.BitsPerPixel = 32;
1436 fmt.BytesPerPixel = 4;
1437 fmt.Rmask = 0x000000ff;
1438 fmt.Gmask = 0x0000ff00;
1439 fmt.Bmask = 0x00ff0000;
1440 fmt.Amask = 0xff000000;
1451 RETVAL = SDL_ConvertSurface(surface,&fmt,surface->flags);
1456 BlitSurface ( src, src_rect, dest, dest_rect )
1462 RETVAL = SDL_BlitSurface(src,src_rect,dest,dest_rect);
1467 FillRect ( dest, dest_rect, color )
1472 Uint32 pixel = SDL_MapRGB(dest->format,color->r,color->g,color->b);
1473 RETVAL = SDL_FillRect(dest,dest_rect,pixel);
1480 RETVAL = SDL_GetAppState();
1486 WMSetCaption ( title, icon )
1490 SDL_WM_SetCaption(title,icon);
1496 SDL_WM_GetCaption(&title,&icon);
1498 av_push(RETVAL,newSVpv(title,0));
1499 av_push(RETVAL,newSVpv(icon,0));
1507 SDL_WM_SetIcon(icon,NULL);
1522 mask = SDL_GetMouseState(&x,&y);
1524 av_push(RETVAL,newSViv(mask));
1525 av_push(RETVAL,newSViv(x));
1526 av_push(RETVAL,newSViv(y));
1531 GetRelativeMouseState ()
1536 mask = SDL_GetRelativeMouseState(&x,&y);
1538 av_push(RETVAL,newSViv(mask));
1539 av_push(RETVAL,newSViv(x));
1540 av_push(RETVAL,newSViv(y));
1545 NewCursor ( data, mask, x ,y )
1551 RETVAL = SDL_CreateCursor((Uint8*)data->pixels,
1552 (Uint8*)mask->pixels,data->w,data->h,x,y);
1557 FreeCursor ( cursor )
1560 SDL_FreeCursor(cursor);
1563 SetCursor ( cursor )
1566 SDL_SetCursor(cursor);
1571 RETVAL = SDL_GetCursor();
1576 ShowCursor ( toggle )
1579 RETVAL = SDL_ShowCursor(toggle);
1584 NewAudioSpec ( freq, format, channels, samples )
1590 RETVAL = (SDL_AudioSpec *)safemalloc(sizeof(SDL_AudioSpec));
1591 RETVAL->freq = freq;
1592 RETVAL->format = format;
1593 RETVAL->channels = channels;
1594 RETVAL->samples = samples;
1599 FreeAudioSpec ( spec )
1605 NewAudioCVT ( src_format, src_channels, src_rate, dst_format, dst_channels, dst_rate)
1613 RETVAL = (SDL_AudioCVT *)safemalloc(sizeof(SDL_AudioCVT));
1614 if (SDL_BuildAudioCVT(RETVAL,src_format, src_channels, src_rate,
1615 dst_format, dst_channels, dst_rate)) {
1616 safefree(RETVAL); RETVAL = NULL; }
1621 FreeAudioCVT ( cvt )
1627 ConvertAudioData ( cvt, data, len )
1633 cvt->buf = (Uint8*) safemalloc(cvt->len*cvt->len_mult);
1634 memcpy(cvt->buf,data,cvt->len);
1635 RETVAL = SDL_ConvertAudio(cvt);
1640 OpenAudio ( spec, callback )
1644 spec->userdata = (void*)callback;
1645 spec->callback = sdl_perl_audio_callback;
1646 RETVAL = SDL_OpenAudio(spec,NULL);
1653 RETVAL = SDL_GetAudioStatus ();
1661 SDL_PauseAudio(p_on);
1685 LoadWAV ( filename, spec )
1689 SDL_AudioSpec *temp;
1694 temp = SDL_LoadWAV(filename,spec,&buf,&len);
1695 if ( ! temp ) goto error;
1696 av_push(RETVAL,newSViv(PTR2IV(temp)));
1697 av_push(RETVAL,newSViv(PTR2IV(buf)));
1698 av_push(RETVAL,newSViv(len));
1703 #ifdef HAVE_SDL_MIXER
1706 MixAudio ( dst, src, len, volume )
1712 SDL_MixAudio(dst,src,len,volume);
1715 MixOpenAudio ( frequency, format, channels, chunksize )
1721 RETVAL = Mix_OpenAudio(frequency, format, channels, chunksize);
1726 MixAllocateChannels ( number )
1729 RETVAL = Mix_AllocateChannels(number);
1736 int freq, channels, status;
1738 status = Mix_QuerySpec(&freq,&format,&channels);
1740 av_push(RETVAL,newSViv(status));
1741 av_push(RETVAL,newSViv(freq));
1742 av_push(RETVAL,newSViv(format));
1743 av_push(RETVAL,newSViv(channels));
1748 MixLoadWAV ( filename )
1751 RETVAL = Mix_LoadWAV(filename);
1756 MixLoadMusic ( filename )
1759 RETVAL = Mix_LoadMUS(filename);
1764 MixQuickLoadWAV ( buf )
1767 RETVAL = Mix_QuickLoad_WAV(buf);
1772 MixFreeChunk( chunk )
1775 Mix_FreeChunk(chunk);
1778 MixFreeMusic ( music )
1781 Mix_FreeMusic(music);
1784 MixSetPostMixCallback ( func, arg )
1788 Mix_SetPostMix(func,arg);
1793 RETVAL = sdl_perl_music_callback;
1798 MixSetMusicHook ( func, arg )
1802 Mix_HookMusic(func,arg);
1805 MixSetMusicFinishedHook ( func )
1808 mix_music_finished_cv = func;
1809 Mix_HookMusicFinished(sdl_perl_music_finished_callback);
1812 MixGetMusicHookData ()
1814 RETVAL = Mix_GetMusicHookData();
1819 MixReverseChannels ( number )
1822 RETVAL = Mix_ReserveChannels ( number );
1827 MixGroupChannel ( which, tag )
1831 RETVAL = Mix_GroupChannel(which,tag);
1836 MixGroupChannels ( from, to, tag )
1841 RETVAL = Mix_GroupChannels(from,to,tag);
1846 MixGroupAvailable ( tag )
1849 RETVAL = Mix_GroupAvailable(tag);
1854 MixGroupCount ( tag )
1857 RETVAL = Mix_GroupCount(tag);
1862 MixGroupOldest ( tag )
1865 RETVAL = Mix_GroupOldest(tag);
1870 MixGroupNewer ( tag )
1873 RETVAL = Mix_GroupNewer(tag);
1878 MixPlayChannel ( channel, chunk, loops )
1883 RETVAL = Mix_PlayChannel(channel,chunk,loops);
1888 MixPlayChannelTimed ( channel, chunk, loops, ticks )
1894 RETVAL = Mix_PlayChannelTimed(channel,chunk,loops,ticks);
1899 MixPlayMusic ( music, loops )
1903 RETVAL = Mix_PlayMusic(music,loops);
1908 MixFadeInChannel ( channel, chunk, loops, ms )
1914 RETVAL = Mix_FadeInChannel(channel,chunk,loops,ms);
1919 MixFadeInChannelTimed ( channel, chunk, loops, ms, ticks )
1926 RETVAL = Mix_FadeInChannelTimed(channel,chunk,loops,ms,ticks);
1931 MixFadeInMusic ( music, loops, ms )
1936 RETVAL = Mix_FadeInMusic(music,loops,ms);
1941 MixVolume ( channel, volume )
1945 RETVAL = Mix_Volume(channel,volume);
1950 MixVolumeChunk ( chunk, volume )
1954 RETVAL = Mix_VolumeChunk(chunk,volume);
1959 MixVolumeMusic ( volume )
1962 RETVAL = Mix_VolumeMusic(volume);
1967 MixHaltChannel ( channel )
1970 RETVAL = Mix_HaltChannel(channel);
1975 MixHaltGroup ( tag )
1978 RETVAL = Mix_HaltGroup(tag);
1985 RETVAL = Mix_HaltMusic();
1990 MixExpireChannel ( channel, ticks )
1994 RETVAL = Mix_ExpireChannel ( channel,ticks);
1999 MixFadeOutChannel ( which, ms )
2003 RETVAL = Mix_FadeOutChannel(which,ms);
2008 MixFadeOutGroup ( which, ms )
2012 RETVAL = Mix_FadeOutGroup(which,ms);
2017 MixFadeOutMusic ( ms )
2020 RETVAL = Mix_FadeOutMusic(ms);
2027 RETVAL = Mix_FadingMusic();
2032 MixFadingChannel( which )
2035 RETVAL = Mix_FadingChannel(which);
2040 MixPause ( channel )
2046 MixResume ( channel )
2049 Mix_Resume(channel);
2052 MixPaused ( channel )
2055 RETVAL = Mix_Paused(channel);
2077 RETVAL = Mix_PausedMusic();
2082 MixPlaying( channel )
2085 RETVAL = Mix_Playing(channel);
2092 RETVAL = Mix_PlayingMusic();
2105 GLLoadLibrary ( path )
2108 RETVAL = SDL_GL_LoadLibrary(path);
2113 GLGetProcAddress ( proc )
2116 RETVAL = SDL_GL_GetProcAddress(proc);
2121 GLSetAttribute ( attr, value )
2125 RETVAL = SDL_GL_SetAttribute(attr, value);
2130 GLGetAttribute ( attr )
2135 av_push(RETVAL,newSViv(SDL_GL_GetAttribute(attr, &value)));
2136 av_push(RETVAL,newSViv(value));
2143 SDL_GL_SwapBuffers ();
2149 RETVAL = (SDL_BYTEORDER == SDL_BIG_ENDIAN);
2156 RETVAL = SDL_NumJoysticks();
2161 JoystickName ( index )
2164 RETVAL = (char*)SDL_JoystickName(index);
2169 JoystickOpen ( index )
2172 RETVAL = SDL_JoystickOpen(index);
2177 JoystickOpened ( index )
2180 RETVAL = SDL_JoystickOpened(index);
2185 JoystickIndex ( joystick )
2186 SDL_Joystick *joystick
2188 RETVAL = SDL_JoystickIndex(joystick);
2193 JoystickNumAxes ( joystick )
2194 SDL_Joystick *joystick
2196 RETVAL = SDL_JoystickNumAxes(joystick);
2201 JoystickNumBalls ( joystick )
2202 SDL_Joystick *joystick
2204 RETVAL = SDL_JoystickNumBalls(joystick);
2209 JoystickNumHats ( joystick )
2210 SDL_Joystick *joystick
2212 RETVAL = SDL_JoystickNumHats(joystick);
2217 JoystickNumButtons ( joystick )
2218 SDL_Joystick *joystick
2220 RETVAL = SDL_JoystickNumButtons(joystick);
2227 SDL_JoystickUpdate();
2230 JoystickGetAxis ( joystick, axis )
2231 SDL_Joystick *joystick
2234 RETVAL = SDL_JoystickGetAxis(joystick,axis);
2239 JoystickGetHat ( joystick, hat )
2240 SDL_Joystick *joystick
2243 RETVAL = SDL_JoystickGetHat(joystick,hat);
2248 JoystickGetButton ( joystick, button)
2249 SDL_Joystick *joystick
2252 RETVAL = SDL_JoystickGetButton(joystick,button);
2257 JoystickGetBall ( joystick, ball )
2258 SDL_Joystick *joystick
2262 success = SDL_JoystickGetBall(joystick,ball,&dx,&dy);
2264 av_push(RETVAL,newSViv(success));
2265 av_push(RETVAL,newSViv(dx));
2266 av_push(RETVAL,newSViv(dy));
2271 JoystickClose ( joystick )
2272 SDL_Joystick *joystick
2274 SDL_JoystickClose(joystick);
2277 JoyAxisEventWhich ( e )
2280 RETVAL = e->jaxis.which;
2285 JoyAxisEventAxis ( e )
2288 RETVAL = e->jaxis.axis;
2293 JoyAxisEventValue ( e )
2296 RETVAL = e->jaxis.value;
2301 JoyButtonEventWhich ( e )
2304 RETVAL = e->jbutton.which;
2309 JoyButtonEventButton ( e )
2312 RETVAL = e->jbutton.button;
2317 JoyButtonEventState ( e )
2320 RETVAL = e->jbutton.state;
2325 JoyHatEventWhich ( e )
2328 RETVAL = e->jhat.which;
2333 JoyHatEventHat ( e )
2336 RETVAL = e->jhat.hat;
2341 JoyHatEventValue ( e )
2344 RETVAL = e->jhat.value;
2349 JoyBallEventWhich ( e )
2352 RETVAL = e->jball.which;
2357 JoyBallEventBall ( e )
2360 RETVAL = e->jball.ball;
2365 JoyBallEventXrel ( e )
2368 RETVAL = e->jball.xrel;
2373 JoyBallEventYrel ( e )
2376 RETVAL = e->jball.yrel;
2381 SetClipRect ( surface, rect )
2382 SDL_Surface *surface
2385 SDL_SetClipRect(surface,rect);
2388 GetClipRect ( surface )
2389 SDL_Surface *surface
2391 RETVAL = (SDL_Rect*) safemalloc(sizeof(SDL_Rect));
2392 SDL_GetClipRect(surface,RETVAL);
2402 RETVAL = SDLNet_Init();
2412 NetNewIPaddress ( host, port )
2416 RETVAL = (IPaddress*) safemalloc(sizeof(IPaddress));
2417 RETVAL->host = host;
2418 RETVAL->port = port;
2423 NetIPaddressHost ( ip )
2431 NetIPaddressPort ( ip )
2439 NetFreeIPaddress ( ip )
2445 NetResolveIP ( address )
2448 RETVAL = SDLNet_ResolveIP(address);
2453 NetResolveHost ( address, host, port )
2458 RETVAL = SDLNet_ResolveHost(address,host,port);
2466 RETVAL = SDLNet_TCP_Open(ip);
2471 NetTCPAccept ( server )
2474 RETVAL = SDLNet_TCP_Accept(server);
2479 NetTCPGetPeerAddress ( sock )
2482 RETVAL = SDLNet_TCP_GetPeerAddress(sock);
2487 NetTCPSend ( sock, data, len )
2492 RETVAL = SDLNet_TCP_Send(sock,data,len);
2497 NetTCPRecv ( sock, maxlen )
2503 buffer = safemalloc(maxlen);
2505 status = SDLNet_TCP_Recv(sock,buffer,maxlen);
2506 av_push(RETVAL,newSViv(status));
2507 av_push(RETVAL,newSVpvn((char*)buffer,maxlen));
2512 NetTCPClose ( sock )
2515 SDLNet_TCP_Close(sock);
2518 NetAllocPacket ( size )
2521 RETVAL = SDLNet_AllocPacket(size);
2526 NetAllocPacketV ( howmany, size )
2530 RETVAL = SDLNet_AllocPacketV(howmany,size);
2535 NetResizePacket ( packet, newsize )
2539 RETVAL = SDLNet_ResizePacket(packet,newsize);
2544 NetFreePacket ( packet )
2547 SDLNet_FreePacket(packet);
2550 NetFreePacketV ( packet )
2553 SDLNet_FreePacketV(packet);
2559 RETVAL = SDLNet_UDP_Open(port);
2564 NetUDPBind ( sock, channel, address )
2569 RETVAL = SDLNet_UDP_Bind(sock,channel,address);
2574 NetUDPUnbind ( sock, channel )
2578 SDLNet_UDP_Unbind(sock,channel);
2581 NetUDPGetPeerAddress ( sock, channel )
2585 RETVAL = SDLNet_UDP_GetPeerAddress(sock,channel);
2590 NetUDPSendV ( sock, packets, npackets )
2595 RETVAL = SDLNet_UDP_SendV(sock,packets,npackets);
2600 NetUDPSend ( sock, channel, packet )
2605 RETVAL = SDLNet_UDP_Send(sock,channel,packet);
2610 NetUDPRecvV ( sock, packets )
2614 RETVAL = SDLNet_UDP_RecvV(sock,packets);
2619 NetUDPRecv ( sock, packet )
2623 RETVAL = SDLNet_UDP_Recv(sock,packet);
2628 NetUDPClose ( sock )
2631 SDLNet_UDP_Close(sock);
2634 NetAllocSocketSet ( maxsockets )
2637 RETVAL = SDLNet_AllocSocketSet(maxsockets);
2642 NetTCP_AddSocket ( set, sock )
2643 SDLNet_SocketSet set
2646 RETVAL = SDLNet_TCP_AddSocket(set,sock);
2651 NetUDP_AddSocket ( set, sock )
2652 SDLNet_SocketSet set
2655 RETVAL = SDLNet_UDP_AddSocket(set,sock);
2660 NetTCP_DelSocket ( set, sock )
2661 SDLNet_SocketSet set
2664 RETVAL = SDLNet_TCP_DelSocket(set,sock);
2669 NetUDP_DelSocket ( set, sock )
2670 SDLNet_SocketSet set
2673 RETVAL = SDLNet_UDP_DelSocket(set,sock);
2678 NetCheckSockets ( set, timeout )
2679 SDLNet_SocketSet set
2682 RETVAL = SDLNet_CheckSockets(set,timeout);
2687 NetSocketReady ( sock )
2688 SDLNet_GenericSocket sock
2690 RETVAL = SDLNet_SocketReady(sock);
2695 NetFreeSocketSet ( set )
2696 SDLNet_SocketSet set
2698 SDLNet_FreeSocketSet(set);
2701 NetWrite16 ( value, area )
2705 SDLNet_Write16(value,area);
2708 NetWrite32 ( value, area )
2712 SDLNet_Write32(value,area);
2718 RETVAL = SDLNet_Read16(area);
2726 RETVAL = SDLNet_Read32(area);
2737 RETVAL = TTF_Init();
2747 TTFOpenFont ( file, ptsize )
2751 RETVAL = TTF_OpenFont(file,ptsize);
2756 TTFGetFontStyle ( font )
2759 RETVAL = TTF_GetFontStyle(font);
2764 TTFSetFontStyle ( font, style )
2768 TTF_SetFontStyle(font,style);
2771 TTFFontHeight ( font )
2774 RETVAL = TTF_FontHeight(font);
2779 TTFFontAscent ( font )
2782 RETVAL = TTF_FontAscent(font);
2787 TTFFontDescent ( font )
2790 RETVAL = TTF_FontDescent(font);
2795 TTFFontLineSkip ( font )
2798 RETVAL = TTF_FontLineSkip(font);
2803 TTFGlyphMetrics ( font, ch )
2807 int minx, miny, maxx, maxy, advance;
2809 TTF_GlyphMetrics(font, ch, &minx, &miny, &maxx, &maxy, &advance);
2810 av_push(RETVAL,newSViv(minx));
2811 av_push(RETVAL,newSViv(miny));
2812 av_push(RETVAL,newSViv(maxx));
2813 av_push(RETVAL,newSViv(maxy));
2814 av_push(RETVAL,newSViv(advance));
2819 TTFSizeText ( font, text )
2825 TTF_SizeText(font,text,&w,&h);
2826 av_push(RETVAL,newSViv(w));
2827 av_push(RETVAL,newSViv(h));
2832 TTFSizeUTF8 ( font, text )
2838 TTF_SizeUTF8(font,text,&w,&h);
2839 av_push(RETVAL,newSViv(w));
2840 av_push(RETVAL,newSViv(h));
2845 TTFSizeUNICODE ( font, text )
2851 TTF_SizeUNICODE(font,text,&w,&h);
2852 av_push(RETVAL,newSViv(w));
2853 av_push(RETVAL,newSViv(h));
2858 TTFRenderTextSolid ( font, text, fg )
2863 RETVAL = TTF_RenderText_Solid(font,text,*fg);
2868 TTFRenderUTF8Solid ( font, text, fg )
2873 RETVAL = TTF_RenderUTF8_Solid(font,text,*fg);
2878 TTFRenderUNICODESolid ( font, text, fg )
2883 RETVAL = TTF_RenderUNICODE_Solid(font,text,*fg);
2888 TTFRenderGlyphSolid ( font, ch, fg )
2893 RETVAL = TTF_RenderGlyph_Solid(font,ch,*fg);
2898 TTFRenderTextShaded ( font, text, fg, bg )
2904 RETVAL = TTF_RenderText_Shaded(font,text,*fg,*bg);
2909 TTFRenderUTF8Shaded( font, text, fg, bg )
2915 RETVAL = TTF_RenderUTF8_Shaded(font,text,*fg,*bg);
2920 TTFRenderUNICODEShaded( font, text, fg, bg )
2926 RETVAL = TTF_RenderUNICODE_Shaded(font,text,*fg,*bg);
2931 TTFRenderGlyphShaded ( font, ch, fg, bg )
2937 RETVAL = TTF_RenderGlyph_Shaded(font,ch,*fg,*bg);
2942 TTFRenderTextBlended( font, text, fg )
2947 RETVAL = TTF_RenderText_Blended(font,text,*fg);
2952 TTFRenderUTF8Blended( font, text, fg )
2957 RETVAL = TTF_RenderUTF8_Blended(font,text,*fg);
2962 TTFRenderUNICODEBlended( font, text, fg )
2967 RETVAL = TTF_RenderUNICODE_Blended(font,text,*fg);
2972 TTFRenderGlyphBlended( font, ch, fg )
2977 RETVAL = TTF_RenderGlyph_Blended(font,ch,*fg);
2982 TTFCloseFont ( font )
2985 TTF_CloseFont(font);
2988 TTFPutString ( font, mode, surface, x, y, fg, bg, text )
2991 SDL_Surface *surface
3006 img = TTF_RenderText_Solid(font,text,*fg);
3007 TTF_SizeText(font,text,&w,&h);
3012 img = TTF_RenderText_Shaded(font,text,*fg,*bg);
3013 TTF_SizeText(font,text,&w,&h);
3018 img = TTF_RenderText_Blended(font,text,*fg);
3019 TTF_SizeText(font,text,&w,&h);
3024 img = TTF_RenderUTF8_Solid(font,text,*fg);
3025 TTF_SizeUTF8(font,text,&w,&h);
3030 img = TTF_RenderUTF8_Shaded(font,text,*fg,*bg);
3031 TTF_SizeUTF8(font,text,&w,&h);
3036 img = TTF_RenderUTF8_Blended(font,text,*fg);
3037 TTF_SizeUTF8(font,text,&w,&h);
3042 img = TTF_RenderUNICODE_Solid(font,(Uint16*)text,*fg);
3043 TTF_SizeUNICODE(font,(Uint16*)text,&w,&h);
3047 case UNICODE_SHADED:
3048 img = TTF_RenderUNICODE_Shaded(font,(Uint16*)text,*fg,*bg);
3049 TTF_SizeUNICODE(font,(Uint16*)text,&w,&h);
3053 case UNICODE_BLENDED:
3054 img = TTF_RenderUNICODE_Blended(font,(Uint16*)text,*fg);
3055 TTF_SizeUNICODE(font,(Uint16*)text,&w,&h);
3060 img = TTF_RenderText_Shaded(font,text,*fg,*bg);
3061 TTF_SizeText(font,text,&w,&h);
3065 if ( img && img->format && img->format->palette ) {
3066 SDL_Color *c = &img->format->palette->colors[0];
3067 Uint32 key = SDL_MapRGB( img->format, c->r, c->g, c->b );
3068 SDL_SetColorKey(img,SDL_SRCCOLORKEY,key );
3069 if (0 > SDL_BlitSurface(img,NULL,surface,&dest)) {
3070 SDL_FreeSurface(img);
3082 CreateYUVOverlay ( width, height, format, display )
3086 SDL_Surface *display
3088 RETVAL = SDL_CreateYUVOverlay ( width, height, format, display );
3093 LockYUVOverlay ( overlay )
3094 SDL_Overlay *overlay
3096 RETVAL = SDL_LockYUVOverlay(overlay);
3101 UnlockYUVOverlay ( overlay )
3102 SDL_Overlay *overlay
3104 SDL_UnlockYUVOverlay(overlay);
3107 DisplayYUVOverlay ( overlay, dstrect )
3108 SDL_Overlay *overlay
3111 RETVAL = SDL_DisplayYUVOverlay ( overlay, dstrect );
3116 FreeYUVOverlay ( overlay )
3117 SDL_Overlay *overlay
3119 SDL_FreeYUVOverlay ( overlay );
3122 OverlayFormat ( overlay, ... )
3123 SDL_Overlay *overlay
3126 overlay->format = SvIV(ST(1));
3127 RETVAL = overlay->format;
3132 OverlayW ( overlay, ... )
3133 SDL_Overlay *overlay
3136 overlay->w = SvIV(ST(1));
3137 RETVAL = overlay->w;
3142 OverlayH ( overlay, ... )
3143 SDL_Overlay *overlay
3146 overlay->h = SvIV(ST(1));
3147 RETVAL = overlay->h;
3152 OverlayPlanes ( overlay, ... )
3153 SDL_Overlay *overlay
3156 overlay->planes = SvIV(ST(1));
3157 RETVAL = overlay->planes;
3162 OverlayHW ( overlay )
3163 SDL_Overlay *overlay
3165 RETVAL = overlay->hw_overlay;
3170 OverlayPitches ( overlay )
3171 SDL_Overlay *overlay
3173 RETVAL = overlay->pitches;
3178 OverlayPixels ( overlay )
3179 SDL_Overlay *overlay
3181 RETVAL = overlay->pixels;
3186 WMToggleFullScreen ( surface )
3187 SDL_Surface *surface
3189 RETVAL = SDL_WM_ToggleFullScreen(surface);
3194 WMGrabInput ( mode )
3197 RETVAL = SDL_WM_GrabInput(mode);
3204 RETVAL = SDL_WM_IconifyWindow();
3212 RETVAL = e->resize.w;
3220 RETVAL = e->resize.h;
3228 RETVAL = SDL_AudioDriverName(name,32);
3236 if (k >= SDLK_LAST) Perl_croak (aTHX_ "Key out of range");
3237 RETVAL = SDL_GetKeyState(NULL)[k];
3246 RETVAL = (SMPEG_Info *) safemalloc (sizeof(SMPEG_Info));
3251 FreeSMPEGInfo ( info )
3257 SMPEGInfoHasAudio ( info )
3260 RETVAL = info->has_audio;
3265 SMPEGInfoHasVideo ( info )
3268 RETVAL = info->has_video;
3273 SMPEGInfoWidth ( info )
3276 RETVAL = info->width;
3281 SMPEGInfoHeight ( info )
3284 RETVAL = info->height;
3289 SMPEGInfoCurrentFrame ( info )
3292 RETVAL = info->current_frame;
3297 SMPEGInfoCurrentFPS ( info )
3300 RETVAL = info->current_fps;
3305 SMPEGInfoCurrentAudioFrame ( info )
3308 RETVAL = info->audio_current_frame;
3313 SMPEGInfoCurrentOffset ( info )
3316 RETVAL = info->current_offset;
3321 SMPEGInfoTotalSize ( info )
3324 RETVAL = info->total_size;
3329 SMPEGInfoCurrentTime ( info )
3332 RETVAL = info->current_time;
3337 SMPEGInfoTotalTime ( info )
3340 RETVAL = info->total_time;
3348 RETVAL = SMPEG_error(mpeg);
3353 NewSMPEG ( filename, info, use_audio )
3358 #ifdef HAVE_SDL_MIXER
3359 RETVAL = SMPEG_new(filename,info,0);
3361 RETVAL = SMPEG_new(filename,info,use_audio);
3373 SMPEGEnableAudio ( mpeg , flag )
3377 SMPEG_enableaudio(mpeg,flag);
3378 #ifdef HAVE_SDL_MIXER
3379 sdl_perl_use_smpeg_audio = flag;
3383 SMPEGEnableVideo ( mpeg , flag )
3387 SMPEG_enablevideo(mpeg,flag);
3390 SMPEGSetVolume ( mpeg , volume )
3394 SMPEG_setvolume(mpeg,volume);
3397 SMPEGSetDisplay ( mpeg, dest, surfLock )
3400 SDL_mutex* surfLock;
3402 SMPEG_setdisplay(mpeg,dest,surfLock,NULL);
3405 SMPEGScaleXY ( mpeg, w, h)
3410 SMPEG_scaleXY(mpeg,w,h);
3413 SMPEGScale ( mpeg, scale )
3417 SMPEG_scale(mpeg,scale);
3423 SDL_AudioSpec audiofmt;
3426 #ifdef HAVE_SDL_MIXER
3427 if (sdl_perl_use_smpeg_audio ) {
3428 SMPEG_enableaudio(mpeg, 0);
3429 Mix_QuerySpec(&freq, &format, &channels);
3430 audiofmt.format = format;
3431 audiofmt.freq = freq;
3432 audiofmt.channels = channels;
3433 SMPEG_actualSpec(mpeg, &audiofmt);
3434 Mix_HookMusic(SMPEG_playAudioSDL, mpeg);
3435 SMPEG_enableaudio(mpeg, 1);
3441 SMPEGStatus ( mpeg )
3444 RETVAL = SMPEG_status(mpeg);
3455 SMPEGLoop ( mpeg, repeat )
3459 SMPEG_loop(mpeg,repeat);
3466 #ifdef HAVE_SDL_MIXER
3467 Mix_HookMusic(NULL, NULL);
3471 SMPEGRewind ( mpeg )
3477 SMPEGSeek ( mpeg, bytes )
3481 SMPEG_seek(mpeg,bytes);
3484 SMPEGSkip ( mpeg, seconds )
3488 SMPEG_skip(mpeg,seconds);
3491 SMPEGSetDisplayRegion ( mpeg, rect )
3495 SMPEG_setdisplayregion(mpeg,rect->x,rect->y,rect->w,rect->h);
3498 SMPEGRenderFrame ( mpeg, frame )
3502 SMPEG_renderFrame(mpeg,frame);
3505 SMPEGGetInfo ( mpeg )
3508 RETVAL = (SMPEG_Info *) safemalloc (sizeof(SMPEG_Info));
3509 SMPEG_getinfo(mpeg,RETVAL);
3519 GFXRotoZoom ( src, angle, zoom, smooth)
3525 RETVAL = rotozoomSurface( src, angle, zoom, smooth);
3530 GFXZoom ( src, zoomx, zoomy, smooth)
3536 RETVAL = zoomSurface( src, zoomx, zoomy, smooth);
3542 GFXPixelColor ( dst, x, y, color )
3548 RETVAL = pixelColor( dst, x, y, color);
3553 GFXPixelRGBA ( dst, x, y, r, g, b, a )
3562 RETVAL = pixelRGBA( dst, x, y, r, g, b, a );
3567 GFXHlineColor ( dst, x1, x2, y, color )
3574 RETVAL = hlineColor( dst, x1, x2, y, color );
3579 GFXHlineRGBA ( dst, x1, x2, y, r, g, b, a )
3589 RETVAL = hlineRGBA( dst, x1, x2, y, r, g, b, a );
3594 GFXVlineColor ( dst, x, y1, y2, color )
3601 RETVAL = vlineColor( dst, x, y1, y2, color );
3606 GFXVlineRGBA ( dst, x, y1, y2, r, g, b, a )
3616 RETVAL = vlineRGBA( dst, x, y1, y2, r, g, b, a );
3621 GFXRectangleColor ( dst, x1, y1, x2, y2, color )
3629 RETVAL = rectangleColor( dst, x1, y1, x2, y2, color );
3634 GFXRectangleRGBA ( dst, x1, y1, x2, y2, r, g, b, a )
3645 RETVAL = rectangleRGBA( dst, x1, y1, x2, y2, r, g, b, a );
3650 GFXBoxColor ( dst, x1, y1, x2, y2, color )
3658 RETVAL = boxColor( dst, x1, y1, x2, y2, color );
3663 GFXBoxRGBA ( dst, x1, y1, x2, y2, r, g, b, a )
3674 RETVAL = boxRGBA( dst, x1, y1, x2, y2, r, g, b, a );
3679 GFXLineColor ( dst, x1, y1, x2, y2, color )
3687 RETVAL = lineColor( dst, x1, y1, x2, y2, color );
3692 GFXLineRGBA ( dst, x1, y1, x2, y2, r, g, b, a )
3703 RETVAL = lineRGBA( dst, x1, y1, x2, y2, r, g, b, a );
3708 GFXAalineColor ( dst, x1, y1, x2, y2, color )
3716 RETVAL = aalineColor( dst, x1, y1, x2, y2, color );
3721 GFXAalineRGBA ( dst, x1, y1, x2, y2, r, g, b, a )
3732 RETVAL = aalineRGBA( dst, x1, y1, x2, y2, r, g, b, a );
3737 GFXCircleColor ( dst, x, y, r, color )
3744 RETVAL = circleColor( dst, x, y, r, color );
3749 GFXCircleRGBA ( dst, x, y, rad, r, g, b, a )
3759 RETVAL = circleRGBA( dst, x, y, rad, r, g, b, a );
3764 GFXAacircleColor ( dst, x, y, r, color )
3771 RETVAL = aacircleColor( dst, x, y, r, color );
3776 GFXAacircleRGBA ( dst, x, y, rad, r, g, b, a )
3786 RETVAL = aacircleRGBA( dst, x, y, rad, r, g, b, a );
3791 GFXFilledCircleColor ( dst, x, y, r, color )
3798 RETVAL = filledCircleColor( dst, x, y, r, color );
3803 GFXFilledCircleRGBA ( dst, x, y, rad, r, g, b, a )
3813 RETVAL = filledCircleRGBA( dst, x, y, rad, r, g, b, a );
3818 GFXEllipseColor ( dst, x, y, rx, ry, color )
3826 RETVAL = ellipseColor( dst, x, y, rx, ry, color );
3831 GFXEllipseRGBA ( dst, x, y, rx, ry, r, g, b, a )
3842 RETVAL = ellipseRGBA( dst, x, y, rx, ry, r, g, b, a );
3847 GFXAaellipseColor ( dst, xc, yc, rx, ry, color )
3855 RETVAL = aaellipseColor( dst, xc, yc, rx, ry, color );
3860 GFXAaellipseRGBA ( dst, x, y, rx, ry, r, g, b, a )
3871 RETVAL = aaellipseRGBA( dst, x, y, rx, ry, r, g, b, a );
3876 GFXFilledEllipseColor ( dst, x, y, rx, ry, color )
3884 RETVAL = filledEllipseColor( dst, x, y, rx, ry, color );
3889 GFXFilledEllipseRGBA ( dst, x, y, rx, ry, r, g, b, a )
3900 RETVAL = filledEllipseRGBA( dst, x, y, rx, ry, r, g, b, a );
3905 GFXFilledpieColor ( dst, x, y, rad, start, end, color )
3914 RETVAL = filledpieColor( dst, x, y, rad, start, end, color );
3919 GFXFilledpieRGBA ( dst, x, y, rad, start, end, r, g, b, a )
3931 RETVAL = filledpieRGBA( dst, x, y, rad, start, end, r, g, b, a );
3936 GFXPolygonColor ( dst, vx, vy, n, color )
3943 RETVAL = polygonColor( dst, vx, vy, n, color );
3948 GFXPolygonRGBA ( dst, vx, vy, n, r, g, b, a )
3958 RETVAL = polygonRGBA( dst, vx, vy, n, r, g, b, a );
3963 GFXAapolygonColor ( dst, vx, vy, n, color )
3970 RETVAL = aapolygonColor( dst, vx, vy, n, color );
3975 GFXAapolygonRGBA ( dst, vx, vy, n, r, g, b, a )
3985 RETVAL = aapolygonRGBA( dst, vx, vy, n, r, g, b, a );
3990 GFXFilledPolygonColor ( dst, vx, vy, n, color )
3997 RETVAL = filledPolygonColor( dst, vx, vy, n, color );
4002 GFXFilledPolygonRGBA ( dst, vx, vy, n, r, g, b, a )
4012 RETVAL = filledPolygonRGBA( dst, vx, vy, n, r, g, b, a );
4017 GFXCharacterColor ( dst, x, y, c, color )
4024 RETVAL = characterColor( dst, x, y, c, color );
4029 GFXCharacterRGBA ( dst, x, y, c, r, g, b, a )
4039 RETVAL = characterRGBA( dst, x, y, c, r, g, b, a );
4044 GFXStringColor ( dst, x, y, c, color )
4051 RETVAL = stringColor( dst, x, y, c, color );
4056 GFXStringRGBA ( dst, x, y, c, r, g, b, a )
4066 RETVAL = stringRGBA( dst, x, y, c, r, g, b, a );
4072 #ifdef HAVE_SDL_SOUND
4075 SoundAudioInfoFormat ( audioinfo )
4076 Sound_AudioInfo* audioinfo
4078 RETVAL = audioinfo->format;
4083 SoundAudioInfoChannels ( audioinfo )
4084 Sound_AudioInfo* audioinfo
4086 RETVAL = audioinfo->channels;
4091 SoundAudioInforate ( audioinfo )
4092 Sound_AudioInfo* audioinfo
4094 RETVAL = audioinfo->rate;
4099 SoundDecoderInfoExtensions ( decoderinfo )
4100 Sound_DecoderInfo* decoderinfo
4103 for ( ext = decoderinfo->extensions; *ext != NULL; ext++ ){
4104 av_push(RETVAL,sv_2mortal(newSVpv(*ext,0)));
4110 SoundDecoderInfoDescription ( decoderinfo )
4111 Sound_DecoderInfo* decoderinfo
4113 RETVAL = decoderinfo->description;
4118 SoundDecoderInfoAuthor ( decoderinfo )
4119 Sound_DecoderInfo* decoderinfo
4121 RETVAL = decoderinfo->author;
4126 SoundDecoderInfoUrl ( decoderinfo )
4127 Sound_DecoderInfo* decoderinfo
4129 RETVAL = decoderinfo->url;
4133 const Sound_DecoderInfo*
4134 SoundSampleDecoder ( sample )
4135 Sound_Sample* sample
4137 RETVAL = sample->decoder;
4142 SoundSampleDesired ( sample )
4143 Sound_Sample* sample
4145 RETVAL = &sample->desired;
4150 SoundSampleAcutal ( sample )
4151 Sound_Sample* sample
4153 RETVAL = &sample->actual;
4158 SoundSampleBuffer ( sample )
4159 Sound_Sample* sample
4161 RETVAL = sample->buffer;
4166 SoundSampleBufferSize ( sample )
4167 Sound_Sample* sample
4169 RETVAL = sample->buffer;
4174 SoundSampleFlags ( sample )
4175 Sound_Sample* sample
4177 RETVAL = (Uint32)sample->flags;
4185 MODULE = SDL PACKAGE = SDL
4186 PROTOTYPES : DISABLE