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)));
1216 NewPalette ( number )
1219 RETVAL = (SDL_Palette *)safemalloc(sizeof(SDL_Palette));
1220 RETVAL->colors = (SDL_Color *)safemalloc(number *
1222 RETVAL->ncolors = number;
1228 PaletteNColors ( palette, ... )
1229 SDL_Palette *palette
1231 if ( items > 1 ) palette->ncolors = SvIV(ST(1));
1232 RETVAL = palette->ncolors;
1237 SetVideoMode ( width, height, bpp, flags )
1245 char *CLASS = "SDL::Surface";
1246 RETVAL = SDL_SetVideoMode(width,height,bpp,flags);
1252 SDL_Surface *surface
1254 RETVAL = SDL_Flip(surface);
1259 BlitSurface ( src, src_rect, dest, dest_rect )
1265 RETVAL = SDL_BlitSurface(src,src_rect,dest,dest_rect);
1270 MapRGB ( pixel_format, r, g, b )
1271 SDL_PixelFormat *pixel_format
1276 RETVAL = SDL_MapRGB(pixel_format,r,g,b);
1281 UpdateRect ( surface, x, y, w ,h )
1282 SDL_Surface *surface
1288 SDL_UpdateRect(surface,x,y,w,h);
1291 DisplayFormat ( surface )
1292 SDL_Surface *surface
1294 char* CLASS = "SDL::Surface";
1295 RETVAL = SDL_DisplayFormat(surface);
1300 DisplayFormatAlpha ( surface )
1301 SDL_Surface *surface
1303 char* CLASS = "SDL::Surface";
1304 RETVAL = SDL_DisplayFormatAlpha(surface);
1309 UpdateRects ( surface, ... )
1310 SDL_Surface *surface
1314 if ( items < 2 ) return;
1315 num_rects = items - 1;
1316 rects = (SDL_Rect *)safemalloc(sizeof(SDL_Rect)*items);
1317 for(i=0;i<num_rects;i++) {
1318 rects[i] = *(SDL_Rect *)SvIV((SV*)SvRV( ST(i + 1) ));
1320 SDL_UpdateRects(surface,num_rects,rects);
1325 Comment out for now as it does not compile
1328 VideoModeOK ( width, height, bpp, flags )
1334 RETVAL = SDL_VideoModeOK(width,height,bpp,flags);
1339 SetVideoMode ( width, height, bpp, flags )
1345 RETVAL = SDL_SetVideoMode(width,height,bpp,flags);
1351 SDL_Surface *surface
1353 RETVAL = SDL_Flip(surface);
1358 SetColors ( surface, start, ... )
1359 SDL_Surface *surface
1362 SDL_Color *colors,*temp;
1364 if ( items < 3 ) { RETVAL = 0; goto all_done; }
1366 colors = (SDL_Color *)safemalloc(sizeof(SDL_Color)*(length+1));
1367 for ( i = 0; i < length ; i++ ) {
1368 temp = (SDL_Color *)SvIV(ST(i+2));
1369 colors[i].r = temp->r;
1370 colors[i].g = temp->g;
1371 colors[i].b = temp->b;
1373 RETVAL = SDL_SetColors(surface, colors, start, length );
1380 MapRGBA ( surface, r, g, b, a )
1381 SDL_Surface *surface
1387 RETVAL = SDL_MapRGBA(surface->format,r,g,b,a);
1392 GetRGB ( surface, pixel )
1393 SDL_Surface *surface
1397 SDL_GetRGB(pixel,surface->format,&r,&g,&b);
1399 av_push(RETVAL,newSViv(r));
1400 av_push(RETVAL,newSViv(g));
1401 av_push(RETVAL,newSViv(b));
1406 GetRGBA ( surface, pixel )
1407 SDL_Surface *surface
1411 SDL_GetRGBA(pixel,surface->format,&r,&g,&b,&a);
1413 av_push(RETVAL,newSViv(r));
1414 av_push(RETVAL,newSViv(g));
1415 av_push(RETVAL,newSViv(b));
1416 av_push(RETVAL,newSViv(a));
1421 SaveBMP ( surface, filename )
1422 SDL_Surface *surface
1425 RETVAL = SDL_SaveBMP(surface,filename);
1430 SetColorKey ( surface, flag, key )
1431 SDL_Surface *surface
1435 Uint32 pixel = SDL_MapRGB(surface->format,key->r,key->g,key->b);
1436 RETVAL = SDL_SetColorKey(surface,flag,pixel);
1441 SetAlpha ( surface, flag, alpha )
1442 SDL_Surface *surface
1446 RETVAL = SDL_SetAlpha(surface,flag,alpha);
1451 ConvertRGB ( surface )
1452 SDL_Surface * surface
1454 SDL_PixelFormat fmt;
1456 fmt.BitsPerPixel = 24;
1457 fmt.BytesPerPixel = 3;
1458 fmt.Rmask = 0x000000ff;
1459 fmt.Gmask = 0x0000ff00;
1460 fmt.Bmask = 0x00ff0000;
1461 fmt.Amask = 0x00000000;
1472 RETVAL = SDL_ConvertSurface(surface,&fmt,surface->flags);
1477 ConvertRGBA ( surface )
1478 SDL_Surface * surface
1480 SDL_PixelFormat fmt;
1482 fmt.BitsPerPixel = 32;
1483 fmt.BytesPerPixel = 4;
1484 fmt.Rmask = 0x000000ff;
1485 fmt.Gmask = 0x0000ff00;
1486 fmt.Bmask = 0x00ff0000;
1487 fmt.Amask = 0xff000000;
1498 RETVAL = SDL_ConvertSurface(surface,&fmt,surface->flags);
1505 FillRect ( dest, dest_rect, pixel )
1510 RETVAL = SDL_FillRect(dest,dest_rect,pixel);
1517 RETVAL = SDL_GetAppState();
1523 WMSetCaption ( title, icon )
1527 SDL_WM_SetCaption(title,icon);
1533 SDL_WM_GetCaption(&title,&icon);
1535 av_push(RETVAL,newSVpv(title,0));
1536 av_push(RETVAL,newSVpv(icon,0));
1544 SDL_WM_SetIcon(icon,NULL);
1559 mask = SDL_GetMouseState(&x,&y);
1561 av_push(RETVAL,newSViv(mask));
1562 av_push(RETVAL,newSViv(x));
1563 av_push(RETVAL,newSViv(y));
1568 GetRelativeMouseState ()
1573 mask = SDL_GetRelativeMouseState(&x,&y);
1575 av_push(RETVAL,newSViv(mask));
1576 av_push(RETVAL,newSViv(x));
1577 av_push(RETVAL,newSViv(y));
1582 NewCursor ( data, mask, x ,y )
1588 RETVAL = SDL_CreateCursor((Uint8*)data->pixels,
1589 (Uint8*)mask->pixels,data->w,data->h,x,y);
1594 FreeCursor ( cursor )
1597 SDL_FreeCursor(cursor);
1600 SetCursor ( cursor )
1603 SDL_SetCursor(cursor);
1608 RETVAL = SDL_GetCursor();
1613 ShowCursor ( toggle )
1616 RETVAL = SDL_ShowCursor(toggle);
1621 NewAudioSpec ( freq, format, channels, samples )
1627 RETVAL = (SDL_AudioSpec *)safemalloc(sizeof(SDL_AudioSpec));
1628 RETVAL->freq = freq;
1629 RETVAL->format = format;
1630 RETVAL->channels = channels;
1631 RETVAL->samples = samples;
1636 FreeAudioSpec ( spec )
1642 NewAudioCVT ( src_format, src_channels, src_rate, dst_format, dst_channels, dst_rate)
1650 RETVAL = (SDL_AudioCVT *)safemalloc(sizeof(SDL_AudioCVT));
1651 if (SDL_BuildAudioCVT(RETVAL,src_format, src_channels, src_rate,
1652 dst_format, dst_channels, dst_rate)) {
1653 safefree(RETVAL); RETVAL = NULL; }
1658 FreeAudioCVT ( cvt )
1664 ConvertAudioData ( cvt, data, len )
1670 cvt->buf = (Uint8*) safemalloc(cvt->len*cvt->len_mult);
1671 memcpy(cvt->buf,data,cvt->len);
1672 RETVAL = SDL_ConvertAudio(cvt);
1677 OpenAudio ( spec, callback )
1681 spec->userdata = (void*)callback;
1682 spec->callback = sdl_perl_audio_callback;
1683 RETVAL = SDL_OpenAudio(spec,NULL);
1690 RETVAL = SDL_GetAudioStatus ();
1698 SDL_PauseAudio(p_on);
1722 LoadWAV ( filename, spec )
1726 SDL_AudioSpec *temp;
1731 temp = SDL_LoadWAV(filename,spec,&buf,&len);
1732 if ( ! temp ) goto error;
1733 av_push(RETVAL,newSViv(PTR2IV(temp)));
1734 av_push(RETVAL,newSViv(PTR2IV(buf)));
1735 av_push(RETVAL,newSViv(len));
1740 #ifdef HAVE_SDL_MIXER
1743 MixAudio ( dst, src, len, volume )
1749 SDL_MixAudio(dst,src,len,volume);
1752 MixOpenAudio ( frequency, format, channels, chunksize )
1758 RETVAL = Mix_OpenAudio(frequency, format, channels, chunksize);
1763 MixAllocateChannels ( number )
1766 RETVAL = Mix_AllocateChannels(number);
1773 int freq, channels, status;
1775 status = Mix_QuerySpec(&freq,&format,&channels);
1777 av_push(RETVAL,newSViv(status));
1778 av_push(RETVAL,newSViv(freq));
1779 av_push(RETVAL,newSViv(format));
1780 av_push(RETVAL,newSViv(channels));
1785 MixLoadWAV ( filename )
1788 RETVAL = Mix_LoadWAV(filename);
1793 MixLoadMusic ( filename )
1796 RETVAL = Mix_LoadMUS(filename);
1801 MixQuickLoadWAV ( buf )
1804 RETVAL = Mix_QuickLoad_WAV(buf);
1809 MixFreeChunk( chunk )
1812 Mix_FreeChunk(chunk);
1815 MixFreeMusic ( music )
1818 Mix_FreeMusic(music);
1821 MixSetPostMixCallback ( func, arg )
1825 Mix_SetPostMix(func,arg);
1830 RETVAL = sdl_perl_music_callback;
1835 MixSetMusicHook ( func, arg )
1839 Mix_HookMusic(func,arg);
1842 MixSetMusicFinishedHook ( func )
1845 mix_music_finished_cv = func;
1846 Mix_HookMusicFinished(sdl_perl_music_finished_callback);
1849 MixGetMusicHookData ()
1851 RETVAL = Mix_GetMusicHookData();
1856 MixReverseChannels ( number )
1859 RETVAL = Mix_ReserveChannels ( number );
1864 MixGroupChannel ( which, tag )
1868 RETVAL = Mix_GroupChannel(which,tag);
1873 MixGroupChannels ( from, to, tag )
1878 RETVAL = Mix_GroupChannels(from,to,tag);
1883 MixGroupAvailable ( tag )
1886 RETVAL = Mix_GroupAvailable(tag);
1891 MixGroupCount ( tag )
1894 RETVAL = Mix_GroupCount(tag);
1899 MixGroupOldest ( tag )
1902 RETVAL = Mix_GroupOldest(tag);
1907 MixGroupNewer ( tag )
1910 RETVAL = Mix_GroupNewer(tag);
1915 MixPlayChannel ( channel, chunk, loops )
1920 RETVAL = Mix_PlayChannel(channel,chunk,loops);
1925 MixPlayChannelTimed ( channel, chunk, loops, ticks )
1931 RETVAL = Mix_PlayChannelTimed(channel,chunk,loops,ticks);
1936 MixPlayMusic ( music, loops )
1940 RETVAL = Mix_PlayMusic(music,loops);
1945 MixFadeInChannel ( channel, chunk, loops, ms )
1951 RETVAL = Mix_FadeInChannel(channel,chunk,loops,ms);
1956 MixFadeInChannelTimed ( channel, chunk, loops, ms, ticks )
1963 RETVAL = Mix_FadeInChannelTimed(channel,chunk,loops,ms,ticks);
1968 MixFadeInMusic ( music, loops, ms )
1973 RETVAL = Mix_FadeInMusic(music,loops,ms);
1978 MixVolume ( channel, volume )
1982 RETVAL = Mix_Volume(channel,volume);
1987 MixVolumeChunk ( chunk, volume )
1991 RETVAL = Mix_VolumeChunk(chunk,volume);
1996 MixVolumeMusic ( volume )
1999 RETVAL = Mix_VolumeMusic(volume);
2004 MixHaltChannel ( channel )
2007 RETVAL = Mix_HaltChannel(channel);
2012 MixHaltGroup ( tag )
2015 RETVAL = Mix_HaltGroup(tag);
2022 RETVAL = Mix_HaltMusic();
2027 MixExpireChannel ( channel, ticks )
2031 RETVAL = Mix_ExpireChannel ( channel,ticks);
2036 MixFadeOutChannel ( which, ms )
2040 RETVAL = Mix_FadeOutChannel(which,ms);
2045 MixFadeOutGroup ( which, ms )
2049 RETVAL = Mix_FadeOutGroup(which,ms);
2054 MixFadeOutMusic ( ms )
2057 RETVAL = Mix_FadeOutMusic(ms);
2064 RETVAL = Mix_FadingMusic();
2069 MixFadingChannel( which )
2072 RETVAL = Mix_FadingChannel(which);
2077 MixPause ( channel )
2083 MixResume ( channel )
2086 Mix_Resume(channel);
2089 MixPaused ( channel )
2092 RETVAL = Mix_Paused(channel);
2114 RETVAL = Mix_PausedMusic();
2119 MixPlaying( channel )
2122 RETVAL = Mix_Playing(channel);
2129 RETVAL = Mix_PlayingMusic();
2134 MixSetPanning ( channel, left, right )
2139 RETVAL = Mix_SetPanning(channel, left, right);
2151 GLLoadLibrary ( path )
2154 RETVAL = SDL_GL_LoadLibrary(path);
2159 GLGetProcAddress ( proc )
2162 RETVAL = SDL_GL_GetProcAddress(proc);
2167 GLSetAttribute ( attr, value )
2171 RETVAL = SDL_GL_SetAttribute(attr, value);
2176 GLGetAttribute ( attr )
2181 av_push(RETVAL,newSViv(SDL_GL_GetAttribute(attr, &value)));
2182 av_push(RETVAL,newSViv(value));
2189 SDL_GL_SwapBuffers ();
2195 RETVAL = (SDL_BYTEORDER == SDL_BIG_ENDIAN);
2202 RETVAL = SDL_NumJoysticks();
2207 JoystickName ( index )
2210 RETVAL = (char*)SDL_JoystickName(index);
2215 JoystickOpen ( index )
2218 RETVAL = SDL_JoystickOpen(index);
2223 JoystickOpened ( index )
2226 RETVAL = SDL_JoystickOpened(index);
2231 JoystickIndex ( joystick )
2232 SDL_Joystick *joystick
2234 RETVAL = SDL_JoystickIndex(joystick);
2239 JoystickNumAxes ( joystick )
2240 SDL_Joystick *joystick
2242 RETVAL = SDL_JoystickNumAxes(joystick);
2247 JoystickNumBalls ( joystick )
2248 SDL_Joystick *joystick
2250 RETVAL = SDL_JoystickNumBalls(joystick);
2255 JoystickNumHats ( joystick )
2256 SDL_Joystick *joystick
2258 RETVAL = SDL_JoystickNumHats(joystick);
2263 JoystickNumButtons ( joystick )
2264 SDL_Joystick *joystick
2266 RETVAL = SDL_JoystickNumButtons(joystick);
2273 SDL_JoystickUpdate();
2276 JoystickGetAxis ( joystick, axis )
2277 SDL_Joystick *joystick
2280 RETVAL = SDL_JoystickGetAxis(joystick,axis);
2285 JoystickGetHat ( joystick, hat )
2286 SDL_Joystick *joystick
2289 RETVAL = SDL_JoystickGetHat(joystick,hat);
2294 JoystickGetButton ( joystick, button)
2295 SDL_Joystick *joystick
2298 RETVAL = SDL_JoystickGetButton(joystick,button);
2303 JoystickGetBall ( joystick, ball )
2304 SDL_Joystick *joystick
2308 success = SDL_JoystickGetBall(joystick,ball,&dx,&dy);
2310 av_push(RETVAL,newSViv(success));
2311 av_push(RETVAL,newSViv(dx));
2312 av_push(RETVAL,newSViv(dy));
2317 JoystickClose ( joystick )
2318 SDL_Joystick *joystick
2320 SDL_JoystickClose(joystick);
2323 JoyAxisEventWhich ( e )
2326 RETVAL = e->jaxis.which;
2331 JoyAxisEventAxis ( e )
2334 RETVAL = e->jaxis.axis;
2339 JoyAxisEventValue ( e )
2342 RETVAL = e->jaxis.value;
2347 JoyButtonEventWhich ( e )
2350 RETVAL = e->jbutton.which;
2355 JoyButtonEventButton ( e )
2358 RETVAL = e->jbutton.button;
2363 JoyButtonEventState ( e )
2366 RETVAL = e->jbutton.state;
2371 JoyHatEventWhich ( e )
2374 RETVAL = e->jhat.which;
2379 JoyHatEventHat ( e )
2382 RETVAL = e->jhat.hat;
2387 JoyHatEventValue ( e )
2390 RETVAL = e->jhat.value;
2395 JoyBallEventWhich ( e )
2398 RETVAL = e->jball.which;
2403 JoyBallEventBall ( e )
2406 RETVAL = e->jball.ball;
2411 JoyBallEventXrel ( e )
2414 RETVAL = e->jball.xrel;
2419 JoyBallEventYrel ( e )
2422 RETVAL = e->jball.yrel;
2427 SetClipRect ( surface, rect )
2428 SDL_Surface *surface
2431 SDL_SetClipRect(surface,rect);
2434 GetClipRect ( surface, rect )
2435 SDL_Surface *surface
2438 SDL_GetClipRect(surface, rect);
2446 RETVAL = SDLNet_Init();
2456 NetNewIPaddress ( host, port )
2460 RETVAL = (IPaddress*) safemalloc(sizeof(IPaddress));
2461 RETVAL->host = host;
2462 RETVAL->port = port;
2467 NetIPaddressHost ( ip )
2475 NetIPaddressPort ( ip )
2483 NetFreeIPaddress ( ip )
2489 NetResolveIP ( address )
2492 RETVAL = SDLNet_ResolveIP(address);
2497 NetResolveHost ( address, host, port )
2502 RETVAL = SDLNet_ResolveHost(address,host,port);
2510 RETVAL = SDLNet_TCP_Open(ip);
2515 NetTCPAccept ( server )
2518 RETVAL = SDLNet_TCP_Accept(server);
2523 NetTCPGetPeerAddress ( sock )
2526 RETVAL = SDLNet_TCP_GetPeerAddress(sock);
2531 NetTCPSend ( sock, data, len )
2536 RETVAL = SDLNet_TCP_Send(sock,data,len);
2541 NetTCPRecv ( sock, maxlen )
2547 buffer = safemalloc(maxlen);
2549 status = SDLNet_TCP_Recv(sock,buffer,maxlen);
2550 av_push(RETVAL,newSViv(status));
2551 av_push(RETVAL,newSVpvn((char*)buffer,maxlen));
2556 NetTCPClose ( sock )
2559 SDLNet_TCP_Close(sock);
2562 NetAllocPacket ( size )
2565 RETVAL = SDLNet_AllocPacket(size);
2570 NetAllocPacketV ( howmany, size )
2574 RETVAL = SDLNet_AllocPacketV(howmany,size);
2579 NetResizePacket ( packet, newsize )
2583 RETVAL = SDLNet_ResizePacket(packet,newsize);
2588 NetFreePacket ( packet )
2591 SDLNet_FreePacket(packet);
2594 NetFreePacketV ( packet )
2597 SDLNet_FreePacketV(packet);
2603 RETVAL = SDLNet_UDP_Open(port);
2608 NetUDPBind ( sock, channel, address )
2613 RETVAL = SDLNet_UDP_Bind(sock,channel,address);
2618 NetUDPUnbind ( sock, channel )
2622 SDLNet_UDP_Unbind(sock,channel);
2625 NetUDPGetPeerAddress ( sock, channel )
2629 RETVAL = SDLNet_UDP_GetPeerAddress(sock,channel);
2634 NetUDPSendV ( sock, packets, npackets )
2639 RETVAL = SDLNet_UDP_SendV(sock,packets,npackets);
2644 NetUDPSend ( sock, channel, packet )
2649 RETVAL = SDLNet_UDP_Send(sock,channel,packet);
2654 NetUDPRecvV ( sock, packets )
2658 RETVAL = SDLNet_UDP_RecvV(sock,packets);
2663 NetUDPRecv ( sock, packet )
2667 RETVAL = SDLNet_UDP_Recv(sock,packet);
2672 NetUDPClose ( sock )
2675 SDLNet_UDP_Close(sock);
2678 NetAllocSocketSet ( maxsockets )
2681 RETVAL = SDLNet_AllocSocketSet(maxsockets);
2686 NetTCP_AddSocket ( set, sock )
2687 SDLNet_SocketSet set
2690 RETVAL = SDLNet_TCP_AddSocket(set,sock);
2695 NetUDP_AddSocket ( set, sock )
2696 SDLNet_SocketSet set
2699 RETVAL = SDLNet_UDP_AddSocket(set,sock);
2704 NetTCP_DelSocket ( set, sock )
2705 SDLNet_SocketSet set
2708 RETVAL = SDLNet_TCP_DelSocket(set,sock);
2713 NetUDP_DelSocket ( set, sock )
2714 SDLNet_SocketSet set
2717 RETVAL = SDLNet_UDP_DelSocket(set,sock);
2722 NetCheckSockets ( set, timeout )
2723 SDLNet_SocketSet set
2726 RETVAL = SDLNet_CheckSockets(set,timeout);
2731 NetSocketReady ( sock )
2732 SDLNet_GenericSocket sock
2734 RETVAL = SDLNet_SocketReady(sock);
2739 NetFreeSocketSet ( set )
2740 SDLNet_SocketSet set
2742 SDLNet_FreeSocketSet(set);
2745 NetWrite16 ( value, area )
2749 SDLNet_Write16(value,area);
2752 NetWrite32 ( value, area )
2756 SDLNet_Write32(value,area);
2762 RETVAL = SDLNet_Read16(area);
2770 RETVAL = SDLNet_Read32(area);
2777 LockYUVOverlay ( overlay )
2778 SDL_Overlay *overlay
2780 RETVAL = SDL_LockYUVOverlay(overlay);
2785 UnlockYUVOverlay ( overlay )
2786 SDL_Overlay *overlay
2788 SDL_UnlockYUVOverlay(overlay);
2791 DisplayYUVOverlay ( overlay, dstrect )
2792 SDL_Overlay *overlay
2795 RETVAL = SDL_DisplayYUVOverlay ( overlay, dstrect );
2800 OverlayFormat ( overlay, ... )
2801 SDL_Overlay *overlay
2804 overlay->format = SvIV(ST(1));
2805 RETVAL = overlay->format;
2810 OverlayW ( overlay, ... )
2811 SDL_Overlay *overlay
2814 overlay->w = SvIV(ST(1));
2815 RETVAL = overlay->w;
2820 OverlayH ( overlay, ... )
2821 SDL_Overlay *overlay
2824 overlay->h = SvIV(ST(1));
2825 RETVAL = overlay->h;
2830 OverlayPlanes ( overlay, ... )
2831 SDL_Overlay *overlay
2834 overlay->planes = SvIV(ST(1));
2835 RETVAL = overlay->planes;
2840 OverlayHW ( overlay )
2841 SDL_Overlay *overlay
2843 RETVAL = overlay->hw_overlay;
2848 OverlayPitches ( overlay )
2849 SDL_Overlay *overlay
2851 RETVAL = overlay->pitches;
2856 OverlayPixels ( overlay )
2857 SDL_Overlay *overlay
2859 RETVAL = overlay->pixels;
2864 WMToggleFullScreen ( surface )
2865 SDL_Surface *surface
2867 RETVAL = SDL_WM_ToggleFullScreen(surface);
2872 WMGrabInput ( mode )
2875 RETVAL = SDL_WM_GrabInput(mode);
2882 RETVAL = SDL_WM_IconifyWindow();
2890 RETVAL = e->resize.w;
2898 RETVAL = e->resize.h;
2906 RETVAL = SDL_AudioDriverName(name,32);
2914 if (k >= SDLK_LAST) Perl_croak (aTHX_ "Key out of range");
2915 RETVAL = SDL_GetKeyState(NULL)[k];
2924 RETVAL = (SMPEG_Info *) safemalloc (sizeof(SMPEG_Info));
2929 FreeSMPEGInfo ( info )
2935 SMPEGInfoHasAudio ( info )
2938 RETVAL = info->has_audio;
2943 SMPEGInfoHasVideo ( info )
2946 RETVAL = info->has_video;
2951 SMPEGInfoWidth ( info )
2954 RETVAL = info->width;
2959 SMPEGInfoHeight ( info )
2962 RETVAL = info->height;
2967 SMPEGInfoCurrentFrame ( info )
2970 RETVAL = info->current_frame;
2975 SMPEGInfoCurrentFPS ( info )
2978 RETVAL = info->current_fps;
2983 SMPEGInfoCurrentAudioFrame ( info )
2986 RETVAL = info->audio_current_frame;
2991 SMPEGInfoCurrentOffset ( info )
2994 RETVAL = info->current_offset;
2999 SMPEGInfoTotalSize ( info )
3002 RETVAL = info->total_size;
3007 SMPEGInfoCurrentTime ( info )
3010 RETVAL = info->current_time;
3015 SMPEGInfoTotalTime ( info )
3018 RETVAL = info->total_time;
3026 RETVAL = SMPEG_error(mpeg);
3031 NewSMPEG ( filename, info, use_audio )
3036 #ifdef HAVE_SDL_MIXER
3037 RETVAL = SMPEG_new(filename,info,0);
3039 RETVAL = SMPEG_new(filename,info,use_audio);
3051 SMPEGEnableAudio ( mpeg , flag )
3055 SMPEG_enableaudio(mpeg,flag);
3056 #ifdef HAVE_SDL_MIXER
3057 sdl_perl_use_smpeg_audio = flag;
3061 SMPEGEnableVideo ( mpeg , flag )
3065 SMPEG_enablevideo(mpeg,flag);
3068 SMPEGSetVolume ( mpeg , volume )
3072 SMPEG_setvolume(mpeg,volume);
3075 SMPEGSetDisplay ( mpeg, dest, surfLock )
3080 SMPEG_setdisplay(mpeg,dest,surfLock,NULL);
3083 SMPEGScaleXY ( mpeg, w, h)
3088 SMPEG_scaleXY(mpeg,w,h);
3091 SMPEGScale ( mpeg, scale )
3095 SMPEG_scale(mpeg,scale);
3101 SDL_AudioSpec audiofmt;
3104 #ifdef HAVE_SDL_MIXER
3105 if (sdl_perl_use_smpeg_audio ) {
3106 SMPEG_enableaudio(mpeg, 0);
3107 Mix_QuerySpec(&freq, &format, &channels);
3108 audiofmt.format = format;
3109 audiofmt.freq = freq;
3110 audiofmt.channels = channels;
3111 SMPEG_actualSpec(mpeg, &audiofmt);
3112 Mix_HookMusic(SMPEG_playAudioSDL, mpeg);
3113 SMPEG_enableaudio(mpeg, 1);
3119 SMPEGStatus ( mpeg )
3122 RETVAL = SMPEG_status(mpeg);
3133 SMPEGLoop ( mpeg, repeat )
3137 SMPEG_loop(mpeg,repeat);
3144 #ifdef HAVE_SDL_MIXER
3145 Mix_HookMusic(NULL, NULL);
3149 SMPEGRewind ( mpeg )
3155 SMPEGSeek ( mpeg, bytes )
3159 SMPEG_seek(mpeg,bytes);
3162 SMPEGSkip ( mpeg, seconds )
3166 SMPEG_skip(mpeg,seconds);
3169 SMPEGSetDisplayRegion ( mpeg, rect )
3173 SMPEG_setdisplayregion(mpeg,rect->x,rect->y,rect->w,rect->h);
3176 SMPEGRenderFrame ( mpeg, frame )
3180 SMPEG_renderFrame(mpeg,frame);
3183 SMPEGGetInfo ( mpeg )
3186 RETVAL = (SMPEG_Info *) safemalloc (sizeof(SMPEG_Info));
3187 SMPEG_getinfo(mpeg,RETVAL);
3199 GFXRotoZoom ( src, angle, zoom, smooth)
3205 RETVAL = rotozoomSurface( src, angle, zoom, smooth);
3210 GFXZoom ( src, zoomx, zoomy, smooth)
3216 RETVAL = zoomSurface( src, zoomx, zoomy, smooth);
3223 GFXPixelColor ( dst, x, y, color )
3229 RETVAL = pixelColor( dst, x, y, color);
3234 GFXPixelRGBA ( dst, x, y, r, g, b, a )
3243 RETVAL = pixelRGBA( dst, x, y, r, g, b, a );
3248 GFXHlineColor ( dst, x1, x2, y, color )
3255 RETVAL = hlineColor( dst, x1, x2, y, color );
3260 GFXHlineRGBA ( dst, x1, x2, y, r, g, b, a )
3270 RETVAL = hlineRGBA( dst, x1, x2, y, r, g, b, a );
3275 GFXVlineColor ( dst, x, y1, y2, color )
3282 RETVAL = vlineColor( dst, x, y1, y2, color );
3287 GFXVlineRGBA ( dst, x, y1, y2, r, g, b, a )
3297 RETVAL = vlineRGBA( dst, x, y1, y2, r, g, b, a );
3302 GFXRectangleColor ( dst, x1, y1, x2, y2, color )
3310 RETVAL = rectangleColor( dst, x1, y1, x2, y2, color );
3315 GFXRectangleRGBA ( dst, x1, y1, x2, y2, r, g, b, a )
3326 RETVAL = rectangleRGBA( dst, x1, y1, x2, y2, r, g, b, a );
3331 GFXBoxColor ( dst, x1, y1, x2, y2, color )
3339 RETVAL = boxColor( dst, x1, y1, x2, y2, color );
3344 GFXBoxRGBA ( dst, x1, y1, x2, y2, r, g, b, a )
3355 RETVAL = boxRGBA( dst, x1, y1, x2, y2, r, g, b, a );
3360 GFXLineColor ( dst, x1, y1, x2, y2, color )
3368 RETVAL = lineColor( dst, x1, y1, x2, y2, color );
3373 GFXLineRGBA ( dst, x1, y1, x2, y2, r, g, b, a )
3384 RETVAL = lineRGBA( dst, x1, y1, x2, y2, r, g, b, a );
3389 GFXAalineColor ( dst, x1, y1, x2, y2, color )
3397 RETVAL = aalineColor( dst, x1, y1, x2, y2, color );
3402 GFXAalineRGBA ( dst, x1, y1, x2, y2, r, g, b, a )
3413 RETVAL = aalineRGBA( dst, x1, y1, x2, y2, r, g, b, a );
3418 GFXCircleColor ( dst, x, y, r, color )
3425 RETVAL = circleColor( dst, x, y, r, color );
3430 GFXCircleRGBA ( dst, x, y, rad, r, g, b, a )
3440 RETVAL = circleRGBA( dst, x, y, rad, r, g, b, a );
3445 GFXAacircleColor ( dst, x, y, r, color )
3452 RETVAL = aacircleColor( dst, x, y, r, color );
3457 GFXAacircleRGBA ( dst, x, y, rad, r, g, b, a )
3467 RETVAL = aacircleRGBA( dst, x, y, rad, r, g, b, a );
3472 GFXFilledCircleColor ( dst, x, y, r, color )
3479 RETVAL = filledCircleColor( dst, x, y, r, color );
3484 GFXFilledCircleRGBA ( dst, x, y, rad, r, g, b, a )
3494 RETVAL = filledCircleRGBA( dst, x, y, rad, r, g, b, a );
3499 GFXEllipseColor ( dst, x, y, rx, ry, color )
3507 RETVAL = ellipseColor( dst, x, y, rx, ry, color );
3512 GFXEllipseRGBA ( dst, x, y, rx, ry, r, g, b, a )
3523 RETVAL = ellipseRGBA( dst, x, y, rx, ry, r, g, b, a );
3528 GFXAaellipseColor ( dst, xc, yc, rx, ry, color )
3536 RETVAL = aaellipseColor( dst, xc, yc, rx, ry, color );
3541 GFXAaellipseRGBA ( dst, x, y, rx, ry, r, g, b, a )
3552 RETVAL = aaellipseRGBA( dst, x, y, rx, ry, r, g, b, a );
3557 GFXFilledEllipseColor ( dst, x, y, rx, ry, color )
3565 RETVAL = filledEllipseColor( dst, x, y, rx, ry, color );
3570 GFXFilledEllipseRGBA ( dst, x, y, rx, ry, r, g, b, a )
3581 RETVAL = filledEllipseRGBA( dst, x, y, rx, ry, r, g, b, a );
3586 GFXFilledPieColor ( dst, x, y, rad, start, end, color )
3595 RETVAL = filledPieColor( dst, x, y, rad, start, end, color );
3600 GFXFilledPieRGBA ( dst, x, y, rad, start, end, r, g, b, a )
3612 RETVAL = filledPieRGBA( dst, x, y, rad, start, end, r, g, b, a );
3617 GFXPolygonColor ( dst, vx, vy, n, color )
3624 RETVAL = polygonColor( dst, vx, vy, n, color );
3629 GFXPolygonRGBA ( dst, vx, vy, n, r, g, b, a )
3639 RETVAL = polygonRGBA( dst, vx, vy, n, r, g, b, a );
3644 GFXAapolygonColor ( dst, vx, vy, n, color )
3651 RETVAL = aapolygonColor( dst, vx, vy, n, color );
3656 GFXAapolygonRGBA ( dst, vx, vy, n, r, g, b, a )
3666 RETVAL = aapolygonRGBA( dst, vx, vy, n, r, g, b, a );
3671 GFXFilledPolygonColor ( dst, vx, vy, n, color )
3678 RETVAL = filledPolygonColor( dst, vx, vy, n, color );
3683 GFXFilledPolygonRGBA ( dst, vx, vy, n, r, g, b, a )
3693 RETVAL = filledPolygonRGBA( dst, vx, vy, n, r, g, b, a );
3698 GFXCharacterColor ( dst, x, y, c, color )
3705 RETVAL = characterColor( dst, x, y, c, color );
3710 GFXCharacterRGBA ( dst, x, y, c, r, g, b, a )
3720 RETVAL = characterRGBA( dst, x, y, c, r, g, b, a );
3725 GFXStringColor ( dst, x, y, c, color )
3732 RETVAL = stringColor( dst, x, y, c, color );
3737 GFXStringRGBA ( dst, x, y, c, r, g, b, a )
3747 RETVAL = stringRGBA( dst, x, y, c, r, g, b, a );
3757 SVG_Load ( filename )
3760 RETVAL = SVG_Load(filename);
3765 SVG_LoadBuffer ( data, len )
3769 RETVAL = SVG_LoadBuffer(data,len);
3774 SVG_SetOffset ( source, xoff, yoff )
3775 SDL_svg_context* source
3779 RETVAL = SVG_SetOffset(source,xoff,yoff);
3784 SVG_SetScale ( source, xscale, yscale )
3785 SDL_svg_context* source
3789 RETVAL = SVG_SetScale(source,xscale,yscale);
3794 SVG_RenderToSurface ( source, x, y, dest )
3795 SDL_svg_context* source
3800 RETVAL = SVG_RenderToSurface(source,x,y,dest);
3806 SDL_svg_context* source
3811 SVG_Set_Flags ( source, flags )
3812 SDL_svg_context* source
3815 SVG_Set_Flags(source,flags);
3818 SVG_Width ( source )
3819 SDL_svg_context* source
3821 RETVAL = SVG_Width(source);
3826 SVG_HEIGHT ( source )
3827 SDL_svg_context* source
3829 RETVAL = SVG_Height(source);
3834 SVG_SetClipping ( source, minx, miny, maxx, maxy )
3835 SDL_svg_context* source
3841 SVG_SetClipping(source,minx,miny,maxx,maxy);
3846 RETVAL = SVG_Version();
3853 #ifdef HAVE_SDL_SOUND
3856 SoundAudioInfoFormat ( audioinfo )
3857 Sound_AudioInfo* audioinfo
3859 RETVAL = audioinfo->format;
3864 SoundAudioInfoChannels ( audioinfo )
3865 Sound_AudioInfo* audioinfo
3867 RETVAL = audioinfo->channels;
3872 SoundAudioInforate ( audioinfo )
3873 Sound_AudioInfo* audioinfo
3875 RETVAL = audioinfo->rate;
3880 SoundDecoderInfoExtensions ( decoderinfo )
3881 Sound_DecoderInfo* decoderinfo
3884 for ( ext = decoderinfo->extensions; *ext != NULL; ext++ ){
3885 av_push(RETVAL,newSVpv(*ext,0));
3891 SoundDecoderInfoDescription ( decoderinfo )
3892 Sound_DecoderInfo* decoderinfo
3894 RETVAL = decoderinfo->description;
3899 SoundDecoderInfoAuthor ( decoderinfo )
3900 Sound_DecoderInfo* decoderinfo
3902 RETVAL = decoderinfo->author;
3907 SoundDecoderInfoUrl ( decoderinfo )
3908 Sound_DecoderInfo* decoderinfo
3910 RETVAL = decoderinfo->url;
3914 const Sound_DecoderInfo*
3915 SoundSampleDecoder ( sample )
3916 Sound_Sample* sample
3918 RETVAL = sample->decoder;
3923 SoundSampleDesired ( sample )
3924 Sound_Sample* sample
3926 RETVAL = &sample->desired;
3931 SoundSampleAcutal ( sample )
3932 Sound_Sample* sample
3934 RETVAL = &sample->actual;
3939 SoundSampleBuffer ( sample )
3940 Sound_Sample* sample
3942 RETVAL = sample->buffer;
3947 SoundSampleBufferSize ( sample )
3948 Sound_Sample* sample
3950 RETVAL = sample->buffer_size;
3955 SoundSampleFlags ( sample )
3956 Sound_Sample* sample
3958 RETVAL = (Uint32)sample->flags;
3965 RETVAL = Sound_Init();
3972 RETVAL = Sound_Quit();
3977 Sound_AvailableDecoders ( )
3980 const Sound_DecoderInfo** sdi;
3981 sdi = Sound_AvailableDecoders();
3983 for (;*sdi != NULL; ++sdi) {
3984 av_push(RETVAL,sv_2mortal(newSViv(PTR2IV(*sdi))));
3993 RETVAL = Sound_GetError();
3998 Sound_ClearError ( )
4003 Sound_NewSample ( rw, ext, desired, buffsize )
4006 Sound_AudioInfo* desired
4009 RETVAL = Sound_NewSample(rw,ext,desired,buffsize);
4014 Sound_NewSampleFromMem ( data, size, ext, desired, buffsize )
4018 Sound_AudioInfo* desired
4021 RETVAL = Sound_NewSampleFromMem(data,size,ext,desired,buffsize);
4026 Sound_NewSampleFromFile ( fname, desired, buffsize )
4028 Sound_AudioInfo* desired
4031 RETVAL = Sound_NewSampleFromFile(fname,desired,buffsize);
4036 Sound_FreeSample ( sample )
4037 Sound_Sample* sample
4039 Sound_FreeSample(sample);
4042 Sound_GetDuration ( sample )
4043 Sound_Sample* sample
4045 RETVAL = Sound_GetDuration(sample);
4050 Sound_SetBufferSize ( sample, size )
4051 Sound_Sample* sample
4054 RETVAL = Sound_SetBufferSize(sample,size);
4059 Sound_Decode ( sample )
4060 Sound_Sample* sample
4062 RETVAL = Sound_Decode(sample);
4067 Sound_DecodeAll ( sample )
4068 Sound_Sample* sample
4070 RETVAL = Sound_DecodeAll(sample);
4075 Sound_Rewind ( sample )
4076 Sound_Sample* sample
4078 RETVAL = Sound_Rewind(sample);
4083 Sound_Seek ( sample, ms )
4084 Sound_Sample* sample
4087 RETVAL = Sound_Seek(sample,ms);
4098 RETVAL = TTF_Init();
4108 TTF_OpenFont ( file, ptsize )
4112 char* CLASS = "SDL::TTF_Font";
4113 RETVAL = TTF_OpenFont(file,ptsize);
4118 TTF_SizeText ( font, text )
4124 if(TTF_SizeText(font,text,&w,&h))
4126 printf("TTF error at TTFSizeText: %s \n", TTF_GetError());
4127 Perl_croak (aTHX_ "TTF error \n");
4131 av_push(RETVAL,newSViv(w));
4132 av_push(RETVAL,newSViv(h));
4133 sv_2mortal((SV*)RETVAL);
4139 TTF_RenderText_Blended ( font, text, fg )
4144 char* CLASS = "SDL::Surface";
4145 RETVAL = TTF_RenderText_Blended(font,text,*fg);
4151 MODULE = SDL PACKAGE = SDL
4152 PROTOTYPES : DISABLE