4 // Copyright (C) 2005 David J. Goehrig <dgoehrig@cpan.org>
6 // ------------------------------------------------------------------------------
8 // This library is free software; you can redistribute it and/or
9 // modify it under the terms of the GNU Lesser General Public
10 // License as published by the Free Software Foundation; either
11 // version 2.1 of the License, or (at your option) any later version.
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // Lesser General Public License for more details.
18 // You should have received a copy of the GNU Lesser General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 // ------------------------------------------------------------------------------
24 // Please feel free to send questions, suggestions or improvements to:
49 #include <SDL_image.h>
53 #include <SDL_mixer.h>
54 void (*mix_music_finished_cv)();
58 #include <SDL_sound.h>
66 #include <smpeg/smpeg.h>
68 static int sdl_perl_use_smpeg_audio = 0;
73 #include <SDL_rotozoom.h>
74 #include <SDL_gfxPrimitives.h>
75 #include <SDL_framerate.h>
76 #include <SDL_imageFilter.h>
88 #define HAVE_TLS_CONTEXT
92 #ifndef SDL_PERL_DEFINES_H
93 #define SDL_PERL_DEFINES_H
95 #ifdef HAVE_TLS_CONTEXT
96 PerlInterpreter *parent_perl = NULL;
97 extern PerlInterpreter *parent_perl;
98 #define GET_TLS_CONTEXT parent_perl = PERL_GET_CONTEXT;
99 #define ENTER_TLS_CONTEXT \
100 PerlInterpreter *current_perl = PERL_GET_CONTEXT; \
101 PERL_SET_CONTEXT(parent_perl); { \
102 PerlInterpreter *my_perl = parent_perl;
103 #define LEAVE_TLS_CONTEXT \
104 } PERL_SET_CONTEXT(current_perl);
106 #define GET_TLS_CONTEXT /* TLS context not enabled */
107 #define ENTER_TLS_CONTEXT /* TLS context not enabled */
108 #define LEAVE_TLS_CONTEXT /* TLS context not enabled */
114 sdl_perl_timer_callback ( Uint32 interval, void* param )
127 XPUSHs(sv_2mortal(newSViv(interval)));
130 if (0 != (back = call_sv(cmd,G_SCALAR))) {
132 if (back != 1 ) Perl_croak (aTHX_ "Timer Callback failed!");
135 Perl_croak(aTHX_ "Timer Callback failed!");
147 sdl_perl_audio_callback ( void* data, Uint8 *stream, int len )
158 XPUSHs(sv_2mortal(newSViv(PTR2IV(stream))));
159 XPUSHs(sv_2mortal(newSViv(len)));
162 call_sv(cmd,G_VOID|G_DISCARD);
171 #ifdef HAVE_SDL_MIXER
174 sdl_perl_music_callback ( void )
180 cmd = (SV*)Mix_GetMusicHookData();
187 call_sv(cmd,G_VOID|G_DISCARD);
197 sdl_perl_music_finished_callback ( void )
203 cmd = (SV*)mix_music_finished_cv;
204 if ( cmd == NULL ) return;
211 call_sv(cmd,G_VOID|G_DISCARD);
222 #define INIT_NS_APPLICATION
223 #define QUIT_NS_APPLICATION
227 sdl_perl_atexit (void)
234 void boot_SDL__OpenGL();
242 MODULE = SDL_perl PACKAGE = SDL
248 RETVAL = SDL_GetError();
257 RETVAL = SDL_Init(flags);
258 #ifdef HAVE_TLS_CONTEXT
259 Perl_call_atexit(PERL_GET_CONTEXT, (void*)sdl_perl_atexit,0);
261 atexit(sdl_perl_atexit);
267 InitSubSystem ( flags )
270 RETVAL = SDL_InitSubSystem(flags);
275 QuitSubSystem ( flags )
278 SDL_QuitSubSystem(flags);
290 RETVAL = SDL_WasInit(flags);
303 RETVAL = SDL_GetTicks();
308 SetTimer ( interval, callback )
310 SDL_TimerCallback callback
312 RETVAL = SDL_SetTimer(interval,callback);
317 AddTimer ( interval, callback, param )
319 SDL_NewTimerCallback callback
322 RETVAL = SDL_AddTimer(interval,callback,param);
329 RETVAL = sdl_perl_timer_callback;
334 NewTimer ( interval, cmd )
338 RETVAL = SDL_AddTimer(interval,sdl_perl_timer_callback,cmd);
346 RETVAL = SDL_RemoveTimer(id);
351 RWFromFile ( file, mode )
355 RETVAL = SDL_RWFromFile(file,mode);
360 RWFromFP ( fp, autoclose )
364 RETVAL = SDL_RWFromFP(fp,autoclose);
369 RWFromMem ( mem, size )
373 RETVAL = SDL_RWFromMem((void*)mem,size);
378 RWFromConstMem ( mem, size )
382 RETVAL = SDL_RWFromConstMem((const void*)mem,size);
389 RETVAL = SDL_AllocRW();
400 RWseek ( rw, off, whence )
405 RETVAL = SDL_RWseek(rw,off,whence);
413 RETVAL = SDL_RWtell(rw);
418 RWread ( rw, mem, size, n )
424 RETVAL = SDL_RWread(rw,mem,size,n);
429 RWwrite ( rw, mem, size, n )
435 RETVAL = SDL_RWwrite(rw,mem,size,n);
443 RETVAL = SDL_RWclose(rw);
450 RETVAL = SDL_CDNumDrives();
458 RETVAL = strdup(SDL_CDName(drive));
466 RETVAL = SDL_CDOpen(drive);
479 CDTrackType ( track )
482 RETVAL = track->type;
487 CDTrackLength ( track )
490 RETVAL = track->length;
495 CDTrackOffset ( track )
498 RETVAL = track->offset;
506 RETVAL = SDL_CDStatus(cd);
511 CDPlayTracks ( cd, start_track, ntracks, start_frame, nframes )
518 RETVAL = SDL_CDPlayTracks(cd,start_track,start_frame,ntracks,nframes);
523 CDPlay ( cd, start, length )
528 RETVAL = SDL_CDPlay(cd,start,length);
536 RETVAL = SDL_CDPause(cd);
544 RETVAL = SDL_CDResume(cd);
552 RETVAL = SDL_CDStop(cd);
560 RETVAL = SDL_CDEject(cd);
582 RETVAL = cd->numtracks;
590 RETVAL = cd->cur_track;
598 RETVAL = cd->cur_frame;
603 CDTrack ( cd, number )
607 RETVAL = (SDL_CDtrack *)(cd->track + number);
620 RETVAL = SDL_PushEvent( e );
627 RETVAL = (SDL_Event *) safemalloc (sizeof(SDL_Event));
641 RETVAL = SDL_PollEvent(e);
649 RETVAL = SDL_WaitEvent(e);
654 EventState ( type, state )
658 RETVAL = SDL_EventState(type,state);
671 SetEventType ( e, type )
681 ActiveEventGain ( e )
684 RETVAL = e->active.gain;
689 ActiveEventState ( e )
692 RETVAL = e->active.state;
700 RETVAL = e->key.state;
708 RETVAL = e->key.keysym.sym;
716 RETVAL = e->key.keysym.mod;
721 KeyEventUnicode ( e )
724 RETVAL = e->key.keysym.unicode;
729 KeyEventScanCode ( e )
732 RETVAL = e->key.keysym.scancode;
737 MouseMotionState ( e )
740 RETVAL = e->motion.state;
748 RETVAL = e->motion.x;
756 RETVAL = e->motion.y;
764 RETVAL = e->motion.xrel;
769 MouseMotionYrel ( e )
772 RETVAL = e->motion.yrel;
777 MouseButtonState ( e )
780 RETVAL = e->button.state;
788 RETVAL = e->button.button;
796 RETVAL = e->button.x;
804 RETVAL = e->button.y;
812 RETVAL = e->syswm.msg;
817 EnableUnicode ( enable )
820 RETVAL = SDL_EnableUNICODE(enable);
825 EnableKeyRepeat ( delay, interval )
829 SDL_EnableKeyRepeat(delay,interval);
834 RETVAL = SDL_GetModState();
839 SetModState ( state )
842 SDL_SetModState(state);
848 RETVAL = SDL_GetKeyName(sym);
852 #ifdef HAVE_SDL_IMAGE
855 IMG_Load ( filename )
858 char* CLASS = "SDL::Surface";
859 RETVAL = IMG_Load(filename);
867 Comment out for now as it does not compile
870 CreateRGBSurfaceFrom (pixels, width, height, depth, pitch, Rmask, Gmask, Bmask, Amask )
882 Uint32 len = pitch * height;
883 New(0,pixeldata,len,Uint8);
884 Copy(pixels,pixeldata,len,Uint8);
885 RETVAL = SDL_CreateRGBSurfaceFrom ( pixeldata, width, height,
886 depth, pitch, Rmask, Gmask, Bmask, Amask );
891 SurfaceCopy ( surface )
895 Uint32 size = surface->pitch * surface->h;
896 New(0,pixels,size,Uint8);
897 Copy(surface->pixels,pixels,size,Uint8);
898 RETVAL = SDL_CreateRGBSurfaceFrom(pixels,surface->w,surface->h,
899 surface->format->BitsPerPixel, surface->pitch,
900 surface->format->Rmask, surface->format->Gmask,
901 surface->format->Bmask, surface->format->Amask);
906 FreeSurface ( surface )
910 Uint8* pixels = surface->pixels;
911 Uint32 flags = surface->flags;
912 SDL_FreeSurface(surface);
913 if (flags & SDL_PREALLOC)
918 SurfaceFlags ( surface )
921 RETVAL = surface->flags;
926 SurfacePalette ( surface )
929 RETVAL = surface->format->palette;
934 SurfaceBitsPerPixel ( surface )
937 RETVAL = surface->format->BitsPerPixel;
942 SurfaceBytesPerPixel ( surface )
945 RETVAL = surface->format->BytesPerPixel;
950 SurfaceRshift ( surface )
953 RETVAL = surface->format->Rshift;
958 SurfaceGshift ( surface )
961 RETVAL = surface->format->Gshift;
966 SurfaceBshift ( surface )
969 RETVAL = surface->format->Bshift;
974 SurfaceAshift ( surface )
977 RETVAL = surface->format->Ashift;
982 SurfaceRmask( surface )
985 RETVAL = surface->format->Rmask;
990 SurfaceGmask ( surface )
993 RETVAL = surface->format->Gmask;
998 SurfaceBmask ( surface )
1001 RETVAL = surface->format->Bmask;
1006 SurfaceAmask ( surface )
1007 SDL_Surface *surface
1009 RETVAL = surface->format->Amask;
1014 SurfaceColorKey ( surface )
1015 SDL_Surface *surface
1017 RETVAL = surface->format->colorkey;
1022 SurfaceAlpha( surface )
1023 SDL_Surface *surface
1025 RETVAL = surface->format->alpha;
1030 SurfaceW ( surface )
1031 SDL_Surface *surface
1033 RETVAL = surface->w;
1038 SurfaceH ( surface )
1039 SDL_Surface *surface
1041 RETVAL = surface->h;
1046 SurfacePitch ( surface )
1047 SDL_Surface *surface
1049 RETVAL = surface->pitch;
1054 SurfacePixels ( surface )
1055 SDL_Surface *surface
1057 RETVAL = newSVpvn(surface->pixels,surface->pitch*surface->h);
1065 Comment out for now as it does not compile
1068 SurfacePixel ( surface, x, y, ... )
1069 SDL_Surface *surface
1076 int bpp = surface->format->BytesPerPixel;
1077 Uint8* p = (Uint8*)surface->pixels + bpp*x + surface->pitch*y;
1078 if ( items < 3 || items > 4 )
1079 Perl_croak(aTHX_ "usage: SDL::SurfacePixel(surface,x,y,[color])");
1081 color = (SDL_Color*)SvIV(ST(3));
1082 pix = SDL_MapRGB(surface->format,color->r,color->g,color->b);
1091 if (SDL_BYTEORDER == SDL_BIG_ENDIAN) {
1092 p[0] = (pix >> 16) & 0xff;
1093 p[1] = (pix >> 8) & 0xff;
1097 p[1] = (pix >> 8) & 0xff;
1098 p[2] = (pix >> 16) & 0xff;
1106 RETVAL = (SDL_Color *) safemalloc(sizeof(SDL_Color));
1110 memcpy(RETVAL,&surface->format->palette[index],sizeof(SDL_Color));
1114 SDL_GetRGB(pix,surface->format,&r,&g,&b);
1122 SDL_GetRGB(pix,surface->format,&r,&g,&b);
1132 MUSTLOCK ( surface )
1133 SDL_Surface *surface
1135 RETVAL = SDL_MUSTLOCK(surface);
1140 SurfaceLock ( surface )
1141 SDL_Surface *surface
1143 RETVAL = SDL_LockSurface(surface);
1148 SurfaceUnlock ( surface )
1149 SDL_Surface *surface
1151 SDL_UnlockSurface(surface);
1156 RETVAL = SDL_GetVideoSurface();
1166 SDL_VideoInfo *info;
1167 info = (SDL_VideoInfo *) safemalloc ( sizeof(SDL_VideoInfo));
1168 memcpy(info,SDL_GetVideoInfo(),sizeof(SDL_VideoInfo));
1170 hv_store(hv,"hw_available",strlen("hw_available"),
1171 newSViv(info->hw_available),0);
1172 hv_store(hv,"wm_available",strlen("wm_available"),
1173 newSViv(info->wm_available),0);
1174 hv_store(hv,"blit_hw",strlen("blit_hw"),
1175 newSViv(info->blit_hw),0);
1176 hv_store(hv,"blit_hw_CC",strlen("blit_hw_CC"),
1177 newSViv(info->blit_hw_CC),0);
1178 hv_store(hv,"blit_hw_A",strlen("blit_hw_A"),
1179 newSViv(info->blit_hw_A),0);
1180 hv_store(hv,"blit_sw",strlen("blit_sw"),
1181 newSViv(info->blit_sw),0);
1182 hv_store(hv,"blit_sw_CC",strlen("blit_sw_CC"),
1183 newSViv(info->blit_sw_CC),0);
1184 hv_store(hv,"blit_sw_A",strlen("blit_sw_A"),
1185 newSViv(info->blit_sw_A),0);
1186 hv_store(hv,"blit_fill",strlen("blit_fill"),
1187 newSViv(info->blit_fill),0);
1188 hv_store(hv,"video_mem",strlen("video_mem"),
1189 newSViv(info->video_mem),0);
1195 ListModes ( format, flags )
1197 SDL_PixelFormat *format
1201 mode = SDL_ListModes(format,flags);
1202 if (mode == (SDL_Rect**)-1 ) {
1203 av_push(RETVAL,newSVpv("all",0));
1204 } else if (! mode ) {
1205 av_push(RETVAL,newSVpv("none",0));
1207 for (;*mode;mode++) {
1208 av_push(RETVAL,newSViv(PTR2IV(*mode)));
1215 NewPalette ( number )
1218 RETVAL = (SDL_Palette *)safemalloc(sizeof(SDL_Palette));
1219 RETVAL->colors = (SDL_Color *)safemalloc(number *
1221 RETVAL->ncolors = number;
1226 PaletteNColors ( palette, ... )
1227 SDL_Palette *palette
1229 if ( items > 1 ) palette->ncolors = SvIV(ST(1));
1230 RETVAL = palette->ncolors;
1235 SetVideoMode ( width, height, bpp, flags )
1243 char *CLASS = "SDL::Surface";
1244 RETVAL = SDL_SetVideoMode(width,height,bpp,flags);
1250 SDL_Surface *surface
1252 RETVAL = SDL_Flip(surface);
1257 BlitSurface ( src, src_rect, dest, dest_rect )
1263 RETVAL = SDL_BlitSurface(src,src_rect,dest,dest_rect);
1268 MapRGB ( pixel_format, r, g, b )
1269 SDL_PixelFormat *pixel_format
1274 RETVAL = SDL_MapRGB(pixel_format,r,g,b);
1279 UpdateRect ( surface, x, y, w ,h )
1280 SDL_Surface *surface
1286 SDL_UpdateRect(surface,x,y,w,h);
1289 DisplayFormat ( surface )
1290 SDL_Surface *surface
1292 char* CLASS = "SDL::Surface";
1293 RETVAL = SDL_DisplayFormat(surface);
1298 DisplayFormatAlpha ( surface )
1299 SDL_Surface *surface
1301 char* CLASS = "SDL::Surface";
1302 RETVAL = SDL_DisplayFormatAlpha(surface);
1307 UpdateRects ( surface, ... )
1308 SDL_Surface *surface
1312 if ( items < 2 ) return;
1313 num_rects = items - 1;
1314 rects = (SDL_Rect *)safemalloc(sizeof(SDL_Rect)*items);
1315 for(i=0;i<num_rects;i++) {
1316 rects[i] = *(SDL_Rect *)SvIV((SV*)SvRV( ST(i + 1) ));
1318 SDL_UpdateRects(surface,num_rects,rects);
1323 Comment out for now as it does not compile
1326 VideoModeOK ( width, height, bpp, flags )
1332 RETVAL = SDL_VideoModeOK(width,height,bpp,flags);
1337 SetVideoMode ( width, height, bpp, flags )
1343 RETVAL = SDL_SetVideoMode(width,height,bpp,flags);
1349 SDL_Surface *surface
1351 RETVAL = SDL_Flip(surface);
1356 SetColors ( surface, start, ... )
1357 SDL_Surface *surface
1360 SDL_Color *colors,*temp;
1362 if ( items < 3 ) { RETVAL = 0; goto all_done; }
1364 colors = (SDL_Color *)safemalloc(sizeof(SDL_Color)*(length+1));
1365 for ( i = 0; i < length ; i++ ) {
1366 temp = (SDL_Color *)SvIV(ST(i+2));
1367 colors[i].r = temp->r;
1368 colors[i].g = temp->g;
1369 colors[i].b = temp->b;
1371 RETVAL = SDL_SetColors(surface, colors, start, length );
1378 MapRGBA ( surface, r, g, b, a )
1379 SDL_Surface *surface
1385 RETVAL = SDL_MapRGBA(surface->format,r,g,b,a);
1390 GetRGB ( surface, pixel )
1391 SDL_Surface *surface
1395 SDL_GetRGB(pixel,surface->format,&r,&g,&b);
1397 av_push(RETVAL,newSViv(r));
1398 av_push(RETVAL,newSViv(g));
1399 av_push(RETVAL,newSViv(b));
1404 GetRGBA ( surface, pixel )
1405 SDL_Surface *surface
1409 SDL_GetRGBA(pixel,surface->format,&r,&g,&b,&a);
1411 av_push(RETVAL,newSViv(r));
1412 av_push(RETVAL,newSViv(g));
1413 av_push(RETVAL,newSViv(b));
1414 av_push(RETVAL,newSViv(a));
1419 SaveBMP ( surface, filename )
1420 SDL_Surface *surface
1423 RETVAL = SDL_SaveBMP(surface,filename);
1428 SetColorKey ( surface, flag, key )
1429 SDL_Surface *surface
1433 Uint32 pixel = SDL_MapRGB(surface->format,key->r,key->g,key->b);
1434 RETVAL = SDL_SetColorKey(surface,flag,pixel);
1439 SetAlpha ( surface, flag, alpha )
1440 SDL_Surface *surface
1444 RETVAL = SDL_SetAlpha(surface,flag,alpha);
1449 ConvertRGB ( surface )
1450 SDL_Surface * surface
1452 SDL_PixelFormat fmt;
1454 fmt.BitsPerPixel = 24;
1455 fmt.BytesPerPixel = 3;
1456 fmt.Rmask = 0x000000ff;
1457 fmt.Gmask = 0x0000ff00;
1458 fmt.Bmask = 0x00ff0000;
1459 fmt.Amask = 0x00000000;
1470 RETVAL = SDL_ConvertSurface(surface,&fmt,surface->flags);
1475 ConvertRGBA ( surface )
1476 SDL_Surface * surface
1478 SDL_PixelFormat fmt;
1480 fmt.BitsPerPixel = 32;
1481 fmt.BytesPerPixel = 4;
1482 fmt.Rmask = 0x000000ff;
1483 fmt.Gmask = 0x0000ff00;
1484 fmt.Bmask = 0x00ff0000;
1485 fmt.Amask = 0xff000000;
1496 RETVAL = SDL_ConvertSurface(surface,&fmt,surface->flags);
1503 FillRect ( dest, dest_rect, pixel )
1508 RETVAL = SDL_FillRect(dest,dest_rect,pixel);
1515 RETVAL = SDL_GetAppState();
1521 WMSetCaption ( title, icon )
1525 SDL_WM_SetCaption(title,icon);
1531 SDL_WM_GetCaption(&title,&icon);
1533 av_push(RETVAL,newSVpv(title,0));
1534 av_push(RETVAL,newSVpv(icon,0));
1542 SDL_WM_SetIcon(icon,NULL);
1557 mask = SDL_GetMouseState(&x,&y);
1559 av_push(RETVAL,newSViv(mask));
1560 av_push(RETVAL,newSViv(x));
1561 av_push(RETVAL,newSViv(y));
1566 GetRelativeMouseState ()
1571 mask = SDL_GetRelativeMouseState(&x,&y);
1573 av_push(RETVAL,newSViv(mask));
1574 av_push(RETVAL,newSViv(x));
1575 av_push(RETVAL,newSViv(y));
1580 NewCursor ( data, mask, x ,y )
1586 RETVAL = SDL_CreateCursor((Uint8*)data->pixels,
1587 (Uint8*)mask->pixels,data->w,data->h,x,y);
1592 FreeCursor ( cursor )
1595 SDL_FreeCursor(cursor);
1598 SetCursor ( cursor )
1601 SDL_SetCursor(cursor);
1606 RETVAL = SDL_GetCursor();
1611 ShowCursor ( toggle )
1614 RETVAL = SDL_ShowCursor(toggle);
1619 NewAudioSpec ( freq, format, channels, samples )
1625 RETVAL = (SDL_AudioSpec *)safemalloc(sizeof(SDL_AudioSpec));
1626 RETVAL->freq = freq;
1627 RETVAL->format = format;
1628 RETVAL->channels = channels;
1629 RETVAL->samples = samples;
1634 FreeAudioSpec ( spec )
1640 NewAudioCVT ( src_format, src_channels, src_rate, dst_format, dst_channels, dst_rate)
1648 RETVAL = (SDL_AudioCVT *)safemalloc(sizeof(SDL_AudioCVT));
1649 if (SDL_BuildAudioCVT(RETVAL,src_format, src_channels, src_rate,
1650 dst_format, dst_channels, dst_rate)) {
1651 safefree(RETVAL); RETVAL = NULL; }
1656 FreeAudioCVT ( cvt )
1662 ConvertAudioData ( cvt, data, len )
1668 cvt->buf = (Uint8*) safemalloc(cvt->len*cvt->len_mult);
1669 memcpy(cvt->buf,data,cvt->len);
1670 RETVAL = SDL_ConvertAudio(cvt);
1675 OpenAudio ( spec, callback )
1679 spec->userdata = (void*)callback;
1680 spec->callback = sdl_perl_audio_callback;
1681 RETVAL = SDL_OpenAudio(spec,NULL);
1688 RETVAL = SDL_GetAudioStatus ();
1696 SDL_PauseAudio(p_on);
1720 LoadWAV ( filename, spec )
1724 SDL_AudioSpec *temp;
1729 temp = SDL_LoadWAV(filename,spec,&buf,&len);
1730 if ( ! temp ) goto error;
1731 av_push(RETVAL,newSViv(PTR2IV(temp)));
1732 av_push(RETVAL,newSViv(PTR2IV(buf)));
1733 av_push(RETVAL,newSViv(len));
1738 #ifdef HAVE_SDL_MIXER
1741 MixAudio ( dst, src, len, volume )
1747 SDL_MixAudio(dst,src,len,volume);
1750 MixOpenAudio ( frequency, format, channels, chunksize )
1756 RETVAL = Mix_OpenAudio(frequency, format, channels, chunksize);
1761 MixAllocateChannels ( number )
1764 RETVAL = Mix_AllocateChannels(number);
1771 int freq, channels, status;
1773 status = Mix_QuerySpec(&freq,&format,&channels);
1775 av_push(RETVAL,newSViv(status));
1776 av_push(RETVAL,newSViv(freq));
1777 av_push(RETVAL,newSViv(format));
1778 av_push(RETVAL,newSViv(channels));
1783 MixLoadWAV ( filename )
1786 RETVAL = Mix_LoadWAV(filename);
1791 MixLoadMusic ( filename )
1794 RETVAL = Mix_LoadMUS(filename);
1799 MixQuickLoadWAV ( buf )
1802 RETVAL = Mix_QuickLoad_WAV(buf);
1807 MixFreeChunk( chunk )
1810 Mix_FreeChunk(chunk);
1813 MixFreeMusic ( music )
1816 Mix_FreeMusic(music);
1819 MixSetPostMixCallback ( func, arg )
1823 Mix_SetPostMix(func,arg);
1828 RETVAL = sdl_perl_music_callback;
1833 MixSetMusicHook ( func, arg )
1837 Mix_HookMusic(func,arg);
1840 MixSetMusicFinishedHook ( func )
1843 mix_music_finished_cv = func;
1844 Mix_HookMusicFinished(sdl_perl_music_finished_callback);
1847 MixGetMusicHookData ()
1849 RETVAL = Mix_GetMusicHookData();
1854 MixReverseChannels ( number )
1857 RETVAL = Mix_ReserveChannels ( number );
1862 MixGroupChannel ( which, tag )
1866 RETVAL = Mix_GroupChannel(which,tag);
1871 MixGroupChannels ( from, to, tag )
1876 RETVAL = Mix_GroupChannels(from,to,tag);
1881 MixGroupAvailable ( tag )
1884 RETVAL = Mix_GroupAvailable(tag);
1889 MixGroupCount ( tag )
1892 RETVAL = Mix_GroupCount(tag);
1897 MixGroupOldest ( tag )
1900 RETVAL = Mix_GroupOldest(tag);
1905 MixGroupNewer ( tag )
1908 RETVAL = Mix_GroupNewer(tag);
1913 MixPlayChannel ( channel, chunk, loops )
1918 RETVAL = Mix_PlayChannel(channel,chunk,loops);
1923 MixPlayChannelTimed ( channel, chunk, loops, ticks )
1929 RETVAL = Mix_PlayChannelTimed(channel,chunk,loops,ticks);
1934 MixPlayMusic ( music, loops )
1938 RETVAL = Mix_PlayMusic(music,loops);
1943 MixFadeInChannel ( channel, chunk, loops, ms )
1949 RETVAL = Mix_FadeInChannel(channel,chunk,loops,ms);
1954 MixFadeInChannelTimed ( channel, chunk, loops, ms, ticks )
1961 RETVAL = Mix_FadeInChannelTimed(channel,chunk,loops,ms,ticks);
1966 MixFadeInMusic ( music, loops, ms )
1971 RETVAL = Mix_FadeInMusic(music,loops,ms);
1976 MixVolume ( channel, volume )
1980 RETVAL = Mix_Volume(channel,volume);
1985 MixVolumeChunk ( chunk, volume )
1989 RETVAL = Mix_VolumeChunk(chunk,volume);
1994 MixVolumeMusic ( volume )
1997 RETVAL = Mix_VolumeMusic(volume);
2002 MixHaltChannel ( channel )
2005 RETVAL = Mix_HaltChannel(channel);
2010 MixHaltGroup ( tag )
2013 RETVAL = Mix_HaltGroup(tag);
2020 RETVAL = Mix_HaltMusic();
2025 MixExpireChannel ( channel, ticks )
2029 RETVAL = Mix_ExpireChannel ( channel,ticks);
2034 MixFadeOutChannel ( which, ms )
2038 RETVAL = Mix_FadeOutChannel(which,ms);
2043 MixFadeOutGroup ( which, ms )
2047 RETVAL = Mix_FadeOutGroup(which,ms);
2052 MixFadeOutMusic ( ms )
2055 RETVAL = Mix_FadeOutMusic(ms);
2062 RETVAL = Mix_FadingMusic();
2067 MixFadingChannel( which )
2070 RETVAL = Mix_FadingChannel(which);
2075 MixPause ( channel )
2081 MixResume ( channel )
2084 Mix_Resume(channel);
2087 MixPaused ( channel )
2090 RETVAL = Mix_Paused(channel);
2112 RETVAL = Mix_PausedMusic();
2117 MixPlaying( channel )
2120 RETVAL = Mix_Playing(channel);
2127 RETVAL = Mix_PlayingMusic();
2132 MixSetPanning ( channel, left, right )
2137 RETVAL = Mix_SetPanning(channel, left, right);
2149 GLLoadLibrary ( path )
2152 RETVAL = SDL_GL_LoadLibrary(path);
2157 GLGetProcAddress ( proc )
2160 RETVAL = SDL_GL_GetProcAddress(proc);
2165 GLSetAttribute ( attr, value )
2169 RETVAL = SDL_GL_SetAttribute(attr, value);
2174 GLGetAttribute ( attr )
2179 av_push(RETVAL,newSViv(SDL_GL_GetAttribute(attr, &value)));
2180 av_push(RETVAL,newSViv(value));
2187 SDL_GL_SwapBuffers ();
2193 RETVAL = (SDL_BYTEORDER == SDL_BIG_ENDIAN);
2200 RETVAL = SDL_NumJoysticks();
2205 JoystickName ( index )
2208 RETVAL = (char*)SDL_JoystickName(index);
2213 JoystickOpen ( index )
2216 RETVAL = SDL_JoystickOpen(index);
2221 JoystickOpened ( index )
2224 RETVAL = SDL_JoystickOpened(index);
2229 JoystickIndex ( joystick )
2230 SDL_Joystick *joystick
2232 RETVAL = SDL_JoystickIndex(joystick);
2237 JoystickNumAxes ( joystick )
2238 SDL_Joystick *joystick
2240 RETVAL = SDL_JoystickNumAxes(joystick);
2245 JoystickNumBalls ( joystick )
2246 SDL_Joystick *joystick
2248 RETVAL = SDL_JoystickNumBalls(joystick);
2253 JoystickNumHats ( joystick )
2254 SDL_Joystick *joystick
2256 RETVAL = SDL_JoystickNumHats(joystick);
2261 JoystickNumButtons ( joystick )
2262 SDL_Joystick *joystick
2264 RETVAL = SDL_JoystickNumButtons(joystick);
2271 SDL_JoystickUpdate();
2274 JoystickGetAxis ( joystick, axis )
2275 SDL_Joystick *joystick
2278 RETVAL = SDL_JoystickGetAxis(joystick,axis);
2283 JoystickGetHat ( joystick, hat )
2284 SDL_Joystick *joystick
2287 RETVAL = SDL_JoystickGetHat(joystick,hat);
2292 JoystickGetButton ( joystick, button)
2293 SDL_Joystick *joystick
2296 RETVAL = SDL_JoystickGetButton(joystick,button);
2301 JoystickGetBall ( joystick, ball )
2302 SDL_Joystick *joystick
2306 success = SDL_JoystickGetBall(joystick,ball,&dx,&dy);
2308 av_push(RETVAL,newSViv(success));
2309 av_push(RETVAL,newSViv(dx));
2310 av_push(RETVAL,newSViv(dy));
2315 JoystickClose ( joystick )
2316 SDL_Joystick *joystick
2318 SDL_JoystickClose(joystick);
2321 JoyAxisEventWhich ( e )
2324 RETVAL = e->jaxis.which;
2329 JoyAxisEventAxis ( e )
2332 RETVAL = e->jaxis.axis;
2337 JoyAxisEventValue ( e )
2340 RETVAL = e->jaxis.value;
2345 JoyButtonEventWhich ( e )
2348 RETVAL = e->jbutton.which;
2353 JoyButtonEventButton ( e )
2356 RETVAL = e->jbutton.button;
2361 JoyButtonEventState ( e )
2364 RETVAL = e->jbutton.state;
2369 JoyHatEventWhich ( e )
2372 RETVAL = e->jhat.which;
2377 JoyHatEventHat ( e )
2380 RETVAL = e->jhat.hat;
2385 JoyHatEventValue ( e )
2388 RETVAL = e->jhat.value;
2393 JoyBallEventWhich ( e )
2396 RETVAL = e->jball.which;
2401 JoyBallEventBall ( e )
2404 RETVAL = e->jball.ball;
2409 JoyBallEventXrel ( e )
2412 RETVAL = e->jball.xrel;
2417 JoyBallEventYrel ( e )
2420 RETVAL = e->jball.yrel;
2425 SetClipRect ( surface, rect )
2426 SDL_Surface *surface
2429 SDL_SetClipRect(surface,rect);
2432 GetClipRect ( surface, rect )
2433 SDL_Surface *surface
2436 SDL_GetClipRect(surface, rect);
2444 RETVAL = SDLNet_Init();
2454 NetNewIPaddress ( host, port )
2458 RETVAL = (IPaddress*) safemalloc(sizeof(IPaddress));
2459 RETVAL->host = host;
2460 RETVAL->port = port;
2465 NetIPaddressHost ( ip )
2473 NetIPaddressPort ( ip )
2481 NetFreeIPaddress ( ip )
2487 NetResolveIP ( address )
2490 RETVAL = SDLNet_ResolveIP(address);
2495 NetResolveHost ( address, host, port )
2500 RETVAL = SDLNet_ResolveHost(address,host,port);
2508 RETVAL = SDLNet_TCP_Open(ip);
2513 NetTCPAccept ( server )
2516 RETVAL = SDLNet_TCP_Accept(server);
2521 NetTCPGetPeerAddress ( sock )
2524 RETVAL = SDLNet_TCP_GetPeerAddress(sock);
2529 NetTCPSend ( sock, data, len )
2534 RETVAL = SDLNet_TCP_Send(sock,data,len);
2539 NetTCPRecv ( sock, maxlen )
2545 buffer = safemalloc(maxlen);
2547 status = SDLNet_TCP_Recv(sock,buffer,maxlen);
2548 av_push(RETVAL,newSViv(status));
2549 av_push(RETVAL,newSVpvn((char*)buffer,maxlen));
2554 NetTCPClose ( sock )
2557 SDLNet_TCP_Close(sock);
2560 NetAllocPacket ( size )
2563 RETVAL = SDLNet_AllocPacket(size);
2568 NetAllocPacketV ( howmany, size )
2572 RETVAL = SDLNet_AllocPacketV(howmany,size);
2577 NetResizePacket ( packet, newsize )
2581 RETVAL = SDLNet_ResizePacket(packet,newsize);
2586 NetFreePacket ( packet )
2589 SDLNet_FreePacket(packet);
2592 NetFreePacketV ( packet )
2595 SDLNet_FreePacketV(packet);
2601 RETVAL = SDLNet_UDP_Open(port);
2606 NetUDPBind ( sock, channel, address )
2611 RETVAL = SDLNet_UDP_Bind(sock,channel,address);
2616 NetUDPUnbind ( sock, channel )
2620 SDLNet_UDP_Unbind(sock,channel);
2623 NetUDPGetPeerAddress ( sock, channel )
2627 RETVAL = SDLNet_UDP_GetPeerAddress(sock,channel);
2632 NetUDPSendV ( sock, packets, npackets )
2637 RETVAL = SDLNet_UDP_SendV(sock,packets,npackets);
2642 NetUDPSend ( sock, channel, packet )
2647 RETVAL = SDLNet_UDP_Send(sock,channel,packet);
2652 NetUDPRecvV ( sock, packets )
2656 RETVAL = SDLNet_UDP_RecvV(sock,packets);
2661 NetUDPRecv ( sock, packet )
2665 RETVAL = SDLNet_UDP_Recv(sock,packet);
2670 NetUDPClose ( sock )
2673 SDLNet_UDP_Close(sock);
2676 NetAllocSocketSet ( maxsockets )
2679 RETVAL = SDLNet_AllocSocketSet(maxsockets);
2684 NetTCP_AddSocket ( set, sock )
2685 SDLNet_SocketSet set
2688 RETVAL = SDLNet_TCP_AddSocket(set,sock);
2693 NetUDP_AddSocket ( set, sock )
2694 SDLNet_SocketSet set
2697 RETVAL = SDLNet_UDP_AddSocket(set,sock);
2702 NetTCP_DelSocket ( set, sock )
2703 SDLNet_SocketSet set
2706 RETVAL = SDLNet_TCP_DelSocket(set,sock);
2711 NetUDP_DelSocket ( set, sock )
2712 SDLNet_SocketSet set
2715 RETVAL = SDLNet_UDP_DelSocket(set,sock);
2720 NetCheckSockets ( set, timeout )
2721 SDLNet_SocketSet set
2724 RETVAL = SDLNet_CheckSockets(set,timeout);
2729 NetSocketReady ( sock )
2730 SDLNet_GenericSocket sock
2732 RETVAL = SDLNet_SocketReady(sock);
2737 NetFreeSocketSet ( set )
2738 SDLNet_SocketSet set
2740 SDLNet_FreeSocketSet(set);
2743 NetWrite16 ( value, area )
2747 SDLNet_Write16(value,area);
2750 NetWrite32 ( value, area )
2754 SDLNet_Write32(value,area);
2760 RETVAL = SDLNet_Read16(area);
2768 RETVAL = SDLNet_Read32(area);
2775 LockYUVOverlay ( overlay )
2776 SDL_Overlay *overlay
2778 RETVAL = SDL_LockYUVOverlay(overlay);
2783 UnlockYUVOverlay ( overlay )
2784 SDL_Overlay *overlay
2786 SDL_UnlockYUVOverlay(overlay);
2789 DisplayYUVOverlay ( overlay, dstrect )
2790 SDL_Overlay *overlay
2793 RETVAL = SDL_DisplayYUVOverlay ( overlay, dstrect );
2798 OverlayFormat ( overlay, ... )
2799 SDL_Overlay *overlay
2802 overlay->format = SvIV(ST(1));
2803 RETVAL = overlay->format;
2808 OverlayW ( overlay, ... )
2809 SDL_Overlay *overlay
2812 overlay->w = SvIV(ST(1));
2813 RETVAL = overlay->w;
2818 OverlayH ( overlay, ... )
2819 SDL_Overlay *overlay
2822 overlay->h = SvIV(ST(1));
2823 RETVAL = overlay->h;
2828 OverlayPlanes ( overlay, ... )
2829 SDL_Overlay *overlay
2832 overlay->planes = SvIV(ST(1));
2833 RETVAL = overlay->planes;
2838 OverlayHW ( overlay )
2839 SDL_Overlay *overlay
2841 RETVAL = overlay->hw_overlay;
2846 OverlayPitches ( overlay )
2847 SDL_Overlay *overlay
2849 RETVAL = overlay->pitches;
2854 OverlayPixels ( overlay )
2855 SDL_Overlay *overlay
2857 RETVAL = overlay->pixels;
2862 WMToggleFullScreen ( surface )
2863 SDL_Surface *surface
2865 RETVAL = SDL_WM_ToggleFullScreen(surface);
2870 WMGrabInput ( mode )
2873 RETVAL = SDL_WM_GrabInput(mode);
2880 RETVAL = SDL_WM_IconifyWindow();
2888 RETVAL = e->resize.w;
2896 RETVAL = e->resize.h;
2904 RETVAL = SDL_AudioDriverName(name,32);
2912 if (k >= SDLK_LAST) Perl_croak (aTHX_ "Key out of range");
2913 RETVAL = SDL_GetKeyState(NULL)[k];
2922 RETVAL = (SMPEG_Info *) safemalloc (sizeof(SMPEG_Info));
2927 FreeSMPEGInfo ( info )
2933 SMPEGInfoHasAudio ( info )
2936 RETVAL = info->has_audio;
2941 SMPEGInfoHasVideo ( info )
2944 RETVAL = info->has_video;
2949 SMPEGInfoWidth ( info )
2952 RETVAL = info->width;
2957 SMPEGInfoHeight ( info )
2960 RETVAL = info->height;
2965 SMPEGInfoCurrentFrame ( info )
2968 RETVAL = info->current_frame;
2973 SMPEGInfoCurrentFPS ( info )
2976 RETVAL = info->current_fps;
2981 SMPEGInfoCurrentAudioFrame ( info )
2984 RETVAL = info->audio_current_frame;
2989 SMPEGInfoCurrentOffset ( info )
2992 RETVAL = info->current_offset;
2997 SMPEGInfoTotalSize ( info )
3000 RETVAL = info->total_size;
3005 SMPEGInfoCurrentTime ( info )
3008 RETVAL = info->current_time;
3013 SMPEGInfoTotalTime ( info )
3016 RETVAL = info->total_time;
3024 RETVAL = SMPEG_error(mpeg);
3029 NewSMPEG ( filename, info, use_audio )
3034 #ifdef HAVE_SDL_MIXER
3035 RETVAL = SMPEG_new(filename,info,0);
3037 RETVAL = SMPEG_new(filename,info,use_audio);
3049 SMPEGEnableAudio ( mpeg , flag )
3053 SMPEG_enableaudio(mpeg,flag);
3054 #ifdef HAVE_SDL_MIXER
3055 sdl_perl_use_smpeg_audio = flag;
3059 SMPEGEnableVideo ( mpeg , flag )
3063 SMPEG_enablevideo(mpeg,flag);
3066 SMPEGSetVolume ( mpeg , volume )
3070 SMPEG_setvolume(mpeg,volume);
3073 SMPEGSetDisplay ( mpeg, dest, surfLock )
3078 SMPEG_setdisplay(mpeg,dest,surfLock,NULL);
3081 SMPEGScaleXY ( mpeg, w, h)
3086 SMPEG_scaleXY(mpeg,w,h);
3089 SMPEGScale ( mpeg, scale )
3093 SMPEG_scale(mpeg,scale);
3099 SDL_AudioSpec audiofmt;
3102 #ifdef HAVE_SDL_MIXER
3103 if (sdl_perl_use_smpeg_audio ) {
3104 SMPEG_enableaudio(mpeg, 0);
3105 Mix_QuerySpec(&freq, &format, &channels);
3106 audiofmt.format = format;
3107 audiofmt.freq = freq;
3108 audiofmt.channels = channels;
3109 SMPEG_actualSpec(mpeg, &audiofmt);
3110 Mix_HookMusic(SMPEG_playAudioSDL, mpeg);
3111 SMPEG_enableaudio(mpeg, 1);
3117 SMPEGStatus ( mpeg )
3120 RETVAL = SMPEG_status(mpeg);
3131 SMPEGLoop ( mpeg, repeat )
3135 SMPEG_loop(mpeg,repeat);
3142 #ifdef HAVE_SDL_MIXER
3143 Mix_HookMusic(NULL, NULL);
3147 SMPEGRewind ( mpeg )
3153 SMPEGSeek ( mpeg, bytes )
3157 SMPEG_seek(mpeg,bytes);
3160 SMPEGSkip ( mpeg, seconds )
3164 SMPEG_skip(mpeg,seconds);
3167 SMPEGSetDisplayRegion ( mpeg, rect )
3171 SMPEG_setdisplayregion(mpeg,rect->x,rect->y,rect->w,rect->h);
3174 SMPEGRenderFrame ( mpeg, frame )
3178 SMPEG_renderFrame(mpeg,frame);
3181 SMPEGGetInfo ( mpeg )
3184 RETVAL = (SMPEG_Info *) safemalloc (sizeof(SMPEG_Info));
3185 SMPEG_getinfo(mpeg,RETVAL);
3197 GFXRotoZoom ( src, angle, zoom, smooth)
3203 RETVAL = rotozoomSurface( src, angle, zoom, smooth);
3208 GFXZoom ( src, zoomx, zoomy, smooth)
3214 RETVAL = zoomSurface( src, zoomx, zoomy, smooth);
3221 GFXPixelColor ( dst, x, y, color )
3227 RETVAL = pixelColor( dst, x, y, color);
3232 GFXPixelRGBA ( dst, x, y, r, g, b, a )
3241 RETVAL = pixelRGBA( dst, x, y, r, g, b, a );
3246 GFXHlineColor ( dst, x1, x2, y, color )
3253 RETVAL = hlineColor( dst, x1, x2, y, color );
3258 GFXHlineRGBA ( dst, x1, x2, y, r, g, b, a )
3268 RETVAL = hlineRGBA( dst, x1, x2, y, r, g, b, a );
3273 GFXVlineColor ( dst, x, y1, y2, color )
3280 RETVAL = vlineColor( dst, x, y1, y2, color );
3285 GFXVlineRGBA ( dst, x, y1, y2, r, g, b, a )
3295 RETVAL = vlineRGBA( dst, x, y1, y2, r, g, b, a );
3300 GFXRectangleColor ( dst, x1, y1, x2, y2, color )
3308 RETVAL = rectangleColor( dst, x1, y1, x2, y2, color );
3313 GFXRectangleRGBA ( dst, x1, y1, x2, y2, r, g, b, a )
3324 RETVAL = rectangleRGBA( dst, x1, y1, x2, y2, r, g, b, a );
3329 GFXBoxColor ( dst, x1, y1, x2, y2, color )
3337 RETVAL = boxColor( dst, x1, y1, x2, y2, color );
3342 GFXBoxRGBA ( dst, x1, y1, x2, y2, r, g, b, a )
3353 RETVAL = boxRGBA( dst, x1, y1, x2, y2, r, g, b, a );
3358 GFXLineColor ( dst, x1, y1, x2, y2, color )
3366 RETVAL = lineColor( dst, x1, y1, x2, y2, color );
3371 GFXLineRGBA ( dst, x1, y1, x2, y2, r, g, b, a )
3382 RETVAL = lineRGBA( dst, x1, y1, x2, y2, r, g, b, a );
3387 GFXAalineColor ( dst, x1, y1, x2, y2, color )
3395 RETVAL = aalineColor( dst, x1, y1, x2, y2, color );
3400 GFXAalineRGBA ( dst, x1, y1, x2, y2, r, g, b, a )
3411 RETVAL = aalineRGBA( dst, x1, y1, x2, y2, r, g, b, a );
3416 GFXCircleColor ( dst, x, y, r, color )
3423 RETVAL = circleColor( dst, x, y, r, color );
3428 GFXCircleRGBA ( dst, x, y, rad, r, g, b, a )
3438 RETVAL = circleRGBA( dst, x, y, rad, r, g, b, a );
3443 GFXAacircleColor ( dst, x, y, r, color )
3450 RETVAL = aacircleColor( dst, x, y, r, color );
3455 GFXAacircleRGBA ( dst, x, y, rad, r, g, b, a )
3465 RETVAL = aacircleRGBA( dst, x, y, rad, r, g, b, a );
3470 GFXFilledCircleColor ( dst, x, y, r, color )
3477 RETVAL = filledCircleColor( dst, x, y, r, color );
3482 GFXFilledCircleRGBA ( dst, x, y, rad, r, g, b, a )
3492 RETVAL = filledCircleRGBA( dst, x, y, rad, r, g, b, a );
3497 GFXEllipseColor ( dst, x, y, rx, ry, color )
3505 RETVAL = ellipseColor( dst, x, y, rx, ry, color );
3510 GFXEllipseRGBA ( dst, x, y, rx, ry, r, g, b, a )
3521 RETVAL = ellipseRGBA( dst, x, y, rx, ry, r, g, b, a );
3526 GFXAaellipseColor ( dst, xc, yc, rx, ry, color )
3534 RETVAL = aaellipseColor( dst, xc, yc, rx, ry, color );
3539 GFXAaellipseRGBA ( dst, x, y, rx, ry, r, g, b, a )
3550 RETVAL = aaellipseRGBA( dst, x, y, rx, ry, r, g, b, a );
3555 GFXFilledEllipseColor ( dst, x, y, rx, ry, color )
3563 RETVAL = filledEllipseColor( dst, x, y, rx, ry, color );
3568 GFXFilledEllipseRGBA ( dst, x, y, rx, ry, r, g, b, a )
3579 RETVAL = filledEllipseRGBA( dst, x, y, rx, ry, r, g, b, a );
3584 GFXFilledPieColor ( dst, x, y, rad, start, end, color )
3593 RETVAL = filledPieColor( dst, x, y, rad, start, end, color );
3598 GFXFilledPieRGBA ( dst, x, y, rad, start, end, r, g, b, a )
3610 RETVAL = filledPieRGBA( dst, x, y, rad, start, end, r, g, b, a );
3615 GFXPolygonColor ( dst, vx, vy, n, color )
3622 RETVAL = polygonColor( dst, vx, vy, n, color );
3627 GFXPolygonRGBA ( dst, vx, vy, n, r, g, b, a )
3637 RETVAL = polygonRGBA( dst, vx, vy, n, r, g, b, a );
3642 GFXAapolygonColor ( dst, vx, vy, n, color )
3649 RETVAL = aapolygonColor( dst, vx, vy, n, color );
3654 GFXAapolygonRGBA ( dst, vx, vy, n, r, g, b, a )
3664 RETVAL = aapolygonRGBA( dst, vx, vy, n, r, g, b, a );
3669 GFXFilledPolygonColor ( dst, vx, vy, n, color )
3676 RETVAL = filledPolygonColor( dst, vx, vy, n, color );
3681 GFXFilledPolygonRGBA ( dst, vx, vy, n, r, g, b, a )
3691 RETVAL = filledPolygonRGBA( dst, vx, vy, n, r, g, b, a );
3696 GFXCharacterColor ( dst, x, y, c, color )
3703 RETVAL = characterColor( dst, x, y, c, color );
3708 GFXCharacterRGBA ( dst, x, y, c, r, g, b, a )
3718 RETVAL = characterRGBA( dst, x, y, c, r, g, b, a );
3723 GFXStringColor ( dst, x, y, c, color )
3730 RETVAL = stringColor( dst, x, y, c, color );
3735 GFXStringRGBA ( dst, x, y, c, r, g, b, a )
3745 RETVAL = stringRGBA( dst, x, y, c, r, g, b, a );
3755 SVG_Load ( filename )
3758 RETVAL = SVG_Load(filename);
3763 SVG_LoadBuffer ( data, len )
3767 RETVAL = SVG_LoadBuffer(data,len);
3772 SVG_SetOffset ( source, xoff, yoff )
3773 SDL_svg_context* source
3777 RETVAL = SVG_SetOffset(source,xoff,yoff);
3782 SVG_SetScale ( source, xscale, yscale )
3783 SDL_svg_context* source
3787 RETVAL = SVG_SetScale(source,xscale,yscale);
3792 SVG_RenderToSurface ( source, x, y, dest )
3793 SDL_svg_context* source
3798 RETVAL = SVG_RenderToSurface(source,x,y,dest);
3804 SDL_svg_context* source
3809 SVG_Set_Flags ( source, flags )
3810 SDL_svg_context* source
3813 SVG_Set_Flags(source,flags);
3816 SVG_Width ( source )
3817 SDL_svg_context* source
3819 RETVAL = SVG_Width(source);
3824 SVG_HEIGHT ( source )
3825 SDL_svg_context* source
3827 RETVAL = SVG_Height(source);
3832 SVG_SetClipping ( source, minx, miny, maxx, maxy )
3833 SDL_svg_context* source
3839 SVG_SetClipping(source,minx,miny,maxx,maxy);
3844 RETVAL = SVG_Version();
3851 #ifdef HAVE_SDL_SOUND
3854 SoundAudioInfoFormat ( audioinfo )
3855 Sound_AudioInfo* audioinfo
3857 RETVAL = audioinfo->format;
3862 SoundAudioInfoChannels ( audioinfo )
3863 Sound_AudioInfo* audioinfo
3865 RETVAL = audioinfo->channels;
3870 SoundAudioInforate ( audioinfo )
3871 Sound_AudioInfo* audioinfo
3873 RETVAL = audioinfo->rate;
3878 SoundDecoderInfoExtensions ( decoderinfo )
3879 Sound_DecoderInfo* decoderinfo
3882 for ( ext = decoderinfo->extensions; *ext != NULL; ext++ ){
3883 av_push(RETVAL,newSVpv(*ext,0));
3889 SoundDecoderInfoDescription ( decoderinfo )
3890 Sound_DecoderInfo* decoderinfo
3892 RETVAL = decoderinfo->description;
3897 SoundDecoderInfoAuthor ( decoderinfo )
3898 Sound_DecoderInfo* decoderinfo
3900 RETVAL = decoderinfo->author;
3905 SoundDecoderInfoUrl ( decoderinfo )
3906 Sound_DecoderInfo* decoderinfo
3908 RETVAL = decoderinfo->url;
3912 const Sound_DecoderInfo*
3913 SoundSampleDecoder ( sample )
3914 Sound_Sample* sample
3916 RETVAL = sample->decoder;
3921 SoundSampleDesired ( sample )
3922 Sound_Sample* sample
3924 RETVAL = &sample->desired;
3929 SoundSampleAcutal ( sample )
3930 Sound_Sample* sample
3932 RETVAL = &sample->actual;
3937 SoundSampleBuffer ( sample )
3938 Sound_Sample* sample
3940 RETVAL = sample->buffer;
3945 SoundSampleBufferSize ( sample )
3946 Sound_Sample* sample
3948 RETVAL = sample->buffer_size;
3953 SoundSampleFlags ( sample )
3954 Sound_Sample* sample
3956 RETVAL = (Uint32)sample->flags;
3963 RETVAL = Sound_Init();
3970 RETVAL = Sound_Quit();
3975 Sound_AvailableDecoders ( )
3978 const Sound_DecoderInfo** sdi;
3979 sdi = Sound_AvailableDecoders();
3981 for (;*sdi != NULL; ++sdi) {
3982 av_push(RETVAL,sv_2mortal(newSViv(PTR2IV(*sdi))));
3991 RETVAL = Sound_GetError();
3996 Sound_ClearError ( )
4001 Sound_NewSample ( rw, ext, desired, buffsize )
4004 Sound_AudioInfo* desired
4007 RETVAL = Sound_NewSample(rw,ext,desired,buffsize);
4012 Sound_NewSampleFromMem ( data, size, ext, desired, buffsize )
4016 Sound_AudioInfo* desired
4019 RETVAL = Sound_NewSampleFromMem(data,size,ext,desired,buffsize);
4024 Sound_NewSampleFromFile ( fname, desired, buffsize )
4026 Sound_AudioInfo* desired
4029 RETVAL = Sound_NewSampleFromFile(fname,desired,buffsize);
4034 Sound_FreeSample ( sample )
4035 Sound_Sample* sample
4037 Sound_FreeSample(sample);
4040 Sound_GetDuration ( sample )
4041 Sound_Sample* sample
4043 RETVAL = Sound_GetDuration(sample);
4048 Sound_SetBufferSize ( sample, size )
4049 Sound_Sample* sample
4052 RETVAL = Sound_SetBufferSize(sample,size);
4057 Sound_Decode ( sample )
4058 Sound_Sample* sample
4060 RETVAL = Sound_Decode(sample);
4065 Sound_DecodeAll ( sample )
4066 Sound_Sample* sample
4068 RETVAL = Sound_DecodeAll(sample);
4073 Sound_Rewind ( sample )
4074 Sound_Sample* sample
4076 RETVAL = Sound_Rewind(sample);
4081 Sound_Seek ( sample, ms )
4082 Sound_Sample* sample
4085 RETVAL = Sound_Seek(sample,ms);
4096 RETVAL = TTF_Init();
4106 TTF_OpenFont ( file, ptsize )
4110 char* CLASS = "SDL::TTF_Font";
4111 RETVAL = TTF_OpenFont(file,ptsize);
4116 TTF_SizeText ( font, text )
4122 if(TTF_SizeText(font,text,&w,&h))
4124 printf("TTF error at TTFSizeText: %s \n", TTF_GetError());
4125 Perl_croak (aTHX_ "TTF error \n");
4129 av_push(RETVAL,newSViv(w));
4130 av_push(RETVAL,newSViv(h));
4131 sv_2mortal((SV*)RETVAL);
4137 TTF_RenderText_Blended ( font, text, fg )
4142 char* CLASS = "SDL::Surface";
4143 RETVAL = TTF_RenderText_Blended(font,text,*fg);
4149 MODULE = SDL PACKAGE = SDL
4150 PROTOTYPES : DISABLE