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 PaletteColors ( palette, index, ... )
1327 SDL_Palette *palette
1331 palette->colors[index].r = SvUV(ST(2));
1332 palette->colors[index].g = SvUV(ST(3));
1333 palette->colors[index].b = SvUV(ST(4));
1335 RETVAL = (SDL_Color *)(palette->colors + index);
1342 VideoModeOK ( width, height, bpp, flags )
1348 RETVAL = SDL_VideoModeOK(width,height,bpp,flags);
1353 SetVideoMode ( width, height, bpp, flags )
1359 RETVAL = SDL_SetVideoMode(width,height,bpp,flags);
1365 SDL_Surface *surface
1367 RETVAL = SDL_Flip(surface);
1372 SetColors ( surface, start, ... )
1373 SDL_Surface *surface
1376 SDL_Color *colors,*temp;
1378 if ( items < 3 ) { RETVAL = 0; goto all_done; }
1380 colors = (SDL_Color *)safemalloc(sizeof(SDL_Color)*(length+1));
1381 for ( i = 0; i < length ; i++ ) {
1382 temp = (SDL_Color *)SvIV(ST(i+2));
1383 colors[i].r = temp->r;
1384 colors[i].g = temp->g;
1385 colors[i].b = temp->b;
1387 RETVAL = SDL_SetColors(surface, colors, start, length );
1394 MapRGBA ( surface, r, g, b, a )
1395 SDL_Surface *surface
1401 RETVAL = SDL_MapRGBA(surface->format,r,g,b,a);
1406 GetRGB ( surface, pixel )
1407 SDL_Surface *surface
1411 SDL_GetRGB(pixel,surface->format,&r,&g,&b);
1413 av_push(RETVAL,newSViv(r));
1414 av_push(RETVAL,newSViv(g));
1415 av_push(RETVAL,newSViv(b));
1420 GetRGBA ( surface, pixel )
1421 SDL_Surface *surface
1425 SDL_GetRGBA(pixel,surface->format,&r,&g,&b,&a);
1427 av_push(RETVAL,newSViv(r));
1428 av_push(RETVAL,newSViv(g));
1429 av_push(RETVAL,newSViv(b));
1430 av_push(RETVAL,newSViv(a));
1435 SaveBMP ( surface, filename )
1436 SDL_Surface *surface
1439 RETVAL = SDL_SaveBMP(surface,filename);
1444 SetColorKey ( surface, flag, key )
1445 SDL_Surface *surface
1449 Uint32 pixel = SDL_MapRGB(surface->format,key->r,key->g,key->b);
1450 RETVAL = SDL_SetColorKey(surface,flag,pixel);
1455 SetAlpha ( surface, flag, alpha )
1456 SDL_Surface *surface
1460 RETVAL = SDL_SetAlpha(surface,flag,alpha);
1465 ConvertRGB ( surface )
1466 SDL_Surface * surface
1468 SDL_PixelFormat fmt;
1470 fmt.BitsPerPixel = 24;
1471 fmt.BytesPerPixel = 3;
1472 fmt.Rmask = 0x000000ff;
1473 fmt.Gmask = 0x0000ff00;
1474 fmt.Bmask = 0x00ff0000;
1475 fmt.Amask = 0x00000000;
1486 RETVAL = SDL_ConvertSurface(surface,&fmt,surface->flags);
1491 ConvertRGBA ( surface )
1492 SDL_Surface * surface
1494 SDL_PixelFormat fmt;
1496 fmt.BitsPerPixel = 32;
1497 fmt.BytesPerPixel = 4;
1498 fmt.Rmask = 0x000000ff;
1499 fmt.Gmask = 0x0000ff00;
1500 fmt.Bmask = 0x00ff0000;
1501 fmt.Amask = 0xff000000;
1512 RETVAL = SDL_ConvertSurface(surface,&fmt,surface->flags);
1519 FillRect ( dest, dest_rect, pixel )
1524 RETVAL = SDL_FillRect(dest,dest_rect,pixel);
1531 RETVAL = SDL_GetAppState();
1537 WMSetCaption ( title, icon )
1541 SDL_WM_SetCaption(title,icon);
1547 SDL_WM_GetCaption(&title,&icon);
1549 av_push(RETVAL,newSVpv(title,0));
1550 av_push(RETVAL,newSVpv(icon,0));
1558 SDL_WM_SetIcon(icon,NULL);
1573 mask = SDL_GetMouseState(&x,&y);
1575 av_push(RETVAL,newSViv(mask));
1576 av_push(RETVAL,newSViv(x));
1577 av_push(RETVAL,newSViv(y));
1582 GetRelativeMouseState ()
1587 mask = SDL_GetRelativeMouseState(&x,&y);
1589 av_push(RETVAL,newSViv(mask));
1590 av_push(RETVAL,newSViv(x));
1591 av_push(RETVAL,newSViv(y));
1596 NewCursor ( data, mask, x ,y )
1602 RETVAL = SDL_CreateCursor((Uint8*)data->pixels,
1603 (Uint8*)mask->pixels,data->w,data->h,x,y);
1608 FreeCursor ( cursor )
1611 SDL_FreeCursor(cursor);
1614 SetCursor ( cursor )
1617 SDL_SetCursor(cursor);
1622 RETVAL = SDL_GetCursor();
1627 ShowCursor ( toggle )
1630 RETVAL = SDL_ShowCursor(toggle);
1635 NewAudioSpec ( freq, format, channels, samples )
1641 RETVAL = (SDL_AudioSpec *)safemalloc(sizeof(SDL_AudioSpec));
1642 RETVAL->freq = freq;
1643 RETVAL->format = format;
1644 RETVAL->channels = channels;
1645 RETVAL->samples = samples;
1650 FreeAudioSpec ( spec )
1656 NewAudioCVT ( src_format, src_channels, src_rate, dst_format, dst_channels, dst_rate)
1664 RETVAL = (SDL_AudioCVT *)safemalloc(sizeof(SDL_AudioCVT));
1665 if (SDL_BuildAudioCVT(RETVAL,src_format, src_channels, src_rate,
1666 dst_format, dst_channels, dst_rate)) {
1667 safefree(RETVAL); RETVAL = NULL; }
1672 FreeAudioCVT ( cvt )
1678 ConvertAudioData ( cvt, data, len )
1684 cvt->buf = (Uint8*) safemalloc(cvt->len*cvt->len_mult);
1685 memcpy(cvt->buf,data,cvt->len);
1686 RETVAL = SDL_ConvertAudio(cvt);
1691 OpenAudio ( spec, callback )
1695 spec->userdata = (void*)callback;
1696 spec->callback = sdl_perl_audio_callback;
1697 RETVAL = SDL_OpenAudio(spec,NULL);
1704 RETVAL = SDL_GetAudioStatus ();
1712 SDL_PauseAudio(p_on);
1736 LoadWAV ( filename, spec )
1740 SDL_AudioSpec *temp;
1745 temp = SDL_LoadWAV(filename,spec,&buf,&len);
1746 if ( ! temp ) goto error;
1747 av_push(RETVAL,newSViv(PTR2IV(temp)));
1748 av_push(RETVAL,newSViv(PTR2IV(buf)));
1749 av_push(RETVAL,newSViv(len));
1754 #ifdef HAVE_SDL_MIXER
1757 MixAudio ( dst, src, len, volume )
1763 SDL_MixAudio(dst,src,len,volume);
1766 MixOpenAudio ( frequency, format, channels, chunksize )
1772 RETVAL = Mix_OpenAudio(frequency, format, channels, chunksize);
1777 MixAllocateChannels ( number )
1780 RETVAL = Mix_AllocateChannels(number);
1787 int freq, channels, status;
1789 status = Mix_QuerySpec(&freq,&format,&channels);
1791 av_push(RETVAL,newSViv(status));
1792 av_push(RETVAL,newSViv(freq));
1793 av_push(RETVAL,newSViv(format));
1794 av_push(RETVAL,newSViv(channels));
1799 MixLoadWAV ( filename )
1802 RETVAL = Mix_LoadWAV(filename);
1807 MixLoadMusic ( filename )
1810 RETVAL = Mix_LoadMUS(filename);
1815 MixQuickLoadWAV ( buf )
1818 RETVAL = Mix_QuickLoad_WAV(buf);
1823 MixFreeChunk( chunk )
1826 Mix_FreeChunk(chunk);
1829 MixFreeMusic ( music )
1832 Mix_FreeMusic(music);
1835 MixSetPostMixCallback ( func, arg )
1839 Mix_SetPostMix(func,arg);
1844 RETVAL = sdl_perl_music_callback;
1849 MixSetMusicHook ( func, arg )
1853 Mix_HookMusic(func,arg);
1856 MixSetMusicFinishedHook ( func )
1859 mix_music_finished_cv = func;
1860 Mix_HookMusicFinished(sdl_perl_music_finished_callback);
1863 MixGetMusicHookData ()
1865 RETVAL = Mix_GetMusicHookData();
1870 MixReverseChannels ( number )
1873 RETVAL = Mix_ReserveChannels ( number );
1878 MixGroupChannel ( which, tag )
1882 RETVAL = Mix_GroupChannel(which,tag);
1887 MixGroupChannels ( from, to, tag )
1892 RETVAL = Mix_GroupChannels(from,to,tag);
1897 MixGroupAvailable ( tag )
1900 RETVAL = Mix_GroupAvailable(tag);
1905 MixGroupCount ( tag )
1908 RETVAL = Mix_GroupCount(tag);
1913 MixGroupOldest ( tag )
1916 RETVAL = Mix_GroupOldest(tag);
1921 MixGroupNewer ( tag )
1924 RETVAL = Mix_GroupNewer(tag);
1929 MixPlayChannel ( channel, chunk, loops )
1934 RETVAL = Mix_PlayChannel(channel,chunk,loops);
1939 MixPlayChannelTimed ( channel, chunk, loops, ticks )
1945 RETVAL = Mix_PlayChannelTimed(channel,chunk,loops,ticks);
1950 MixPlayMusic ( music, loops )
1954 RETVAL = Mix_PlayMusic(music,loops);
1959 MixFadeInChannel ( channel, chunk, loops, ms )
1965 RETVAL = Mix_FadeInChannel(channel,chunk,loops,ms);
1970 MixFadeInChannelTimed ( channel, chunk, loops, ms, ticks )
1977 RETVAL = Mix_FadeInChannelTimed(channel,chunk,loops,ms,ticks);
1982 MixFadeInMusic ( music, loops, ms )
1987 RETVAL = Mix_FadeInMusic(music,loops,ms);
1992 MixVolume ( channel, volume )
1996 RETVAL = Mix_Volume(channel,volume);
2001 MixVolumeChunk ( chunk, volume )
2005 RETVAL = Mix_VolumeChunk(chunk,volume);
2010 MixVolumeMusic ( volume )
2013 RETVAL = Mix_VolumeMusic(volume);
2018 MixHaltChannel ( channel )
2021 RETVAL = Mix_HaltChannel(channel);
2026 MixHaltGroup ( tag )
2029 RETVAL = Mix_HaltGroup(tag);
2036 RETVAL = Mix_HaltMusic();
2041 MixExpireChannel ( channel, ticks )
2045 RETVAL = Mix_ExpireChannel ( channel,ticks);
2050 MixFadeOutChannel ( which, ms )
2054 RETVAL = Mix_FadeOutChannel(which,ms);
2059 MixFadeOutGroup ( which, ms )
2063 RETVAL = Mix_FadeOutGroup(which,ms);
2068 MixFadeOutMusic ( ms )
2071 RETVAL = Mix_FadeOutMusic(ms);
2078 RETVAL = Mix_FadingMusic();
2083 MixFadingChannel( which )
2086 RETVAL = Mix_FadingChannel(which);
2091 MixPause ( channel )
2097 MixResume ( channel )
2100 Mix_Resume(channel);
2103 MixPaused ( channel )
2106 RETVAL = Mix_Paused(channel);
2128 RETVAL = Mix_PausedMusic();
2133 MixPlaying( channel )
2136 RETVAL = Mix_Playing(channel);
2143 RETVAL = Mix_PlayingMusic();
2148 MixSetPanning ( channel, left, right )
2153 RETVAL = Mix_SetPanning(channel, left, right);
2165 GLLoadLibrary ( path )
2168 RETVAL = SDL_GL_LoadLibrary(path);
2173 GLGetProcAddress ( proc )
2176 RETVAL = SDL_GL_GetProcAddress(proc);
2181 GLSetAttribute ( attr, value )
2185 RETVAL = SDL_GL_SetAttribute(attr, value);
2190 GLGetAttribute ( attr )
2195 av_push(RETVAL,newSViv(SDL_GL_GetAttribute(attr, &value)));
2196 av_push(RETVAL,newSViv(value));
2203 SDL_GL_SwapBuffers ();
2209 RETVAL = (SDL_BYTEORDER == SDL_BIG_ENDIAN);
2216 RETVAL = SDL_NumJoysticks();
2221 JoystickName ( index )
2224 RETVAL = (char*)SDL_JoystickName(index);
2229 JoystickOpen ( index )
2232 RETVAL = SDL_JoystickOpen(index);
2237 JoystickOpened ( index )
2240 RETVAL = SDL_JoystickOpened(index);
2245 JoystickIndex ( joystick )
2246 SDL_Joystick *joystick
2248 RETVAL = SDL_JoystickIndex(joystick);
2253 JoystickNumAxes ( joystick )
2254 SDL_Joystick *joystick
2256 RETVAL = SDL_JoystickNumAxes(joystick);
2261 JoystickNumBalls ( joystick )
2262 SDL_Joystick *joystick
2264 RETVAL = SDL_JoystickNumBalls(joystick);
2269 JoystickNumHats ( joystick )
2270 SDL_Joystick *joystick
2272 RETVAL = SDL_JoystickNumHats(joystick);
2277 JoystickNumButtons ( joystick )
2278 SDL_Joystick *joystick
2280 RETVAL = SDL_JoystickNumButtons(joystick);
2287 SDL_JoystickUpdate();
2290 JoystickGetAxis ( joystick, axis )
2291 SDL_Joystick *joystick
2294 RETVAL = SDL_JoystickGetAxis(joystick,axis);
2299 JoystickGetHat ( joystick, hat )
2300 SDL_Joystick *joystick
2303 RETVAL = SDL_JoystickGetHat(joystick,hat);
2308 JoystickGetButton ( joystick, button)
2309 SDL_Joystick *joystick
2312 RETVAL = SDL_JoystickGetButton(joystick,button);
2317 JoystickGetBall ( joystick, ball )
2318 SDL_Joystick *joystick
2322 success = SDL_JoystickGetBall(joystick,ball,&dx,&dy);
2324 av_push(RETVAL,newSViv(success));
2325 av_push(RETVAL,newSViv(dx));
2326 av_push(RETVAL,newSViv(dy));
2331 JoystickClose ( joystick )
2332 SDL_Joystick *joystick
2334 SDL_JoystickClose(joystick);
2337 JoyAxisEventWhich ( e )
2340 RETVAL = e->jaxis.which;
2345 JoyAxisEventAxis ( e )
2348 RETVAL = e->jaxis.axis;
2353 JoyAxisEventValue ( e )
2356 RETVAL = e->jaxis.value;
2361 JoyButtonEventWhich ( e )
2364 RETVAL = e->jbutton.which;
2369 JoyButtonEventButton ( e )
2372 RETVAL = e->jbutton.button;
2377 JoyButtonEventState ( e )
2380 RETVAL = e->jbutton.state;
2385 JoyHatEventWhich ( e )
2388 RETVAL = e->jhat.which;
2393 JoyHatEventHat ( e )
2396 RETVAL = e->jhat.hat;
2401 JoyHatEventValue ( e )
2404 RETVAL = e->jhat.value;
2409 JoyBallEventWhich ( e )
2412 RETVAL = e->jball.which;
2417 JoyBallEventBall ( e )
2420 RETVAL = e->jball.ball;
2425 JoyBallEventXrel ( e )
2428 RETVAL = e->jball.xrel;
2433 JoyBallEventYrel ( e )
2436 RETVAL = e->jball.yrel;
2441 SetClipRect ( surface, rect )
2442 SDL_Surface *surface
2445 SDL_SetClipRect(surface,rect);
2448 GetClipRect ( surface, rect )
2449 SDL_Surface *surface
2452 SDL_GetClipRect(surface, rect);
2460 RETVAL = SDLNet_Init();
2470 NetNewIPaddress ( host, port )
2474 RETVAL = (IPaddress*) safemalloc(sizeof(IPaddress));
2475 RETVAL->host = host;
2476 RETVAL->port = port;
2481 NetIPaddressHost ( ip )
2489 NetIPaddressPort ( ip )
2497 NetFreeIPaddress ( ip )
2503 NetResolveIP ( address )
2506 RETVAL = SDLNet_ResolveIP(address);
2511 NetResolveHost ( address, host, port )
2516 RETVAL = SDLNet_ResolveHost(address,host,port);
2524 RETVAL = SDLNet_TCP_Open(ip);
2529 NetTCPAccept ( server )
2532 RETVAL = SDLNet_TCP_Accept(server);
2537 NetTCPGetPeerAddress ( sock )
2540 RETVAL = SDLNet_TCP_GetPeerAddress(sock);
2545 NetTCPSend ( sock, data, len )
2550 RETVAL = SDLNet_TCP_Send(sock,data,len);
2555 NetTCPRecv ( sock, maxlen )
2561 buffer = safemalloc(maxlen);
2563 status = SDLNet_TCP_Recv(sock,buffer,maxlen);
2564 av_push(RETVAL,newSViv(status));
2565 av_push(RETVAL,newSVpvn((char*)buffer,maxlen));
2570 NetTCPClose ( sock )
2573 SDLNet_TCP_Close(sock);
2576 NetAllocPacket ( size )
2579 RETVAL = SDLNet_AllocPacket(size);
2584 NetAllocPacketV ( howmany, size )
2588 RETVAL = SDLNet_AllocPacketV(howmany,size);
2593 NetResizePacket ( packet, newsize )
2597 RETVAL = SDLNet_ResizePacket(packet,newsize);
2602 NetFreePacket ( packet )
2605 SDLNet_FreePacket(packet);
2608 NetFreePacketV ( packet )
2611 SDLNet_FreePacketV(packet);
2617 RETVAL = SDLNet_UDP_Open(port);
2622 NetUDPBind ( sock, channel, address )
2627 RETVAL = SDLNet_UDP_Bind(sock,channel,address);
2632 NetUDPUnbind ( sock, channel )
2636 SDLNet_UDP_Unbind(sock,channel);
2639 NetUDPGetPeerAddress ( sock, channel )
2643 RETVAL = SDLNet_UDP_GetPeerAddress(sock,channel);
2648 NetUDPSendV ( sock, packets, npackets )
2653 RETVAL = SDLNet_UDP_SendV(sock,packets,npackets);
2658 NetUDPSend ( sock, channel, packet )
2663 RETVAL = SDLNet_UDP_Send(sock,channel,packet);
2668 NetUDPRecvV ( sock, packets )
2672 RETVAL = SDLNet_UDP_RecvV(sock,packets);
2677 NetUDPRecv ( sock, packet )
2681 RETVAL = SDLNet_UDP_Recv(sock,packet);
2686 NetUDPClose ( sock )
2689 SDLNet_UDP_Close(sock);
2692 NetAllocSocketSet ( maxsockets )
2695 RETVAL = SDLNet_AllocSocketSet(maxsockets);
2700 NetTCP_AddSocket ( set, sock )
2701 SDLNet_SocketSet set
2704 RETVAL = SDLNet_TCP_AddSocket(set,sock);
2709 NetUDP_AddSocket ( set, sock )
2710 SDLNet_SocketSet set
2713 RETVAL = SDLNet_UDP_AddSocket(set,sock);
2718 NetTCP_DelSocket ( set, sock )
2719 SDLNet_SocketSet set
2722 RETVAL = SDLNet_TCP_DelSocket(set,sock);
2727 NetUDP_DelSocket ( set, sock )
2728 SDLNet_SocketSet set
2731 RETVAL = SDLNet_UDP_DelSocket(set,sock);
2736 NetCheckSockets ( set, timeout )
2737 SDLNet_SocketSet set
2740 RETVAL = SDLNet_CheckSockets(set,timeout);
2745 NetSocketReady ( sock )
2746 SDLNet_GenericSocket sock
2748 RETVAL = SDLNet_SocketReady(sock);
2753 NetFreeSocketSet ( set )
2754 SDLNet_SocketSet set
2756 SDLNet_FreeSocketSet(set);
2759 NetWrite16 ( value, area )
2763 SDLNet_Write16(value,area);
2766 NetWrite32 ( value, area )
2770 SDLNet_Write32(value,area);
2776 RETVAL = SDLNet_Read16(area);
2784 RETVAL = SDLNet_Read32(area);
2791 LockYUVOverlay ( overlay )
2792 SDL_Overlay *overlay
2794 RETVAL = SDL_LockYUVOverlay(overlay);
2799 UnlockYUVOverlay ( overlay )
2800 SDL_Overlay *overlay
2802 SDL_UnlockYUVOverlay(overlay);
2805 DisplayYUVOverlay ( overlay, dstrect )
2806 SDL_Overlay *overlay
2809 RETVAL = SDL_DisplayYUVOverlay ( overlay, dstrect );
2814 OverlayFormat ( overlay, ... )
2815 SDL_Overlay *overlay
2818 overlay->format = SvIV(ST(1));
2819 RETVAL = overlay->format;
2824 OverlayW ( overlay, ... )
2825 SDL_Overlay *overlay
2828 overlay->w = SvIV(ST(1));
2829 RETVAL = overlay->w;
2834 OverlayH ( overlay, ... )
2835 SDL_Overlay *overlay
2838 overlay->h = SvIV(ST(1));
2839 RETVAL = overlay->h;
2844 OverlayPlanes ( overlay, ... )
2845 SDL_Overlay *overlay
2848 overlay->planes = SvIV(ST(1));
2849 RETVAL = overlay->planes;
2854 OverlayHW ( overlay )
2855 SDL_Overlay *overlay
2857 RETVAL = overlay->hw_overlay;
2862 OverlayPitches ( overlay )
2863 SDL_Overlay *overlay
2865 RETVAL = overlay->pitches;
2870 OverlayPixels ( overlay )
2871 SDL_Overlay *overlay
2873 RETVAL = overlay->pixels;
2878 WMToggleFullScreen ( surface )
2879 SDL_Surface *surface
2881 RETVAL = SDL_WM_ToggleFullScreen(surface);
2886 WMGrabInput ( mode )
2889 RETVAL = SDL_WM_GrabInput(mode);
2896 RETVAL = SDL_WM_IconifyWindow();
2904 RETVAL = e->resize.w;
2912 RETVAL = e->resize.h;
2920 RETVAL = SDL_AudioDriverName(name,32);
2928 if (k >= SDLK_LAST) Perl_croak (aTHX_ "Key out of range");
2929 RETVAL = SDL_GetKeyState(NULL)[k];
2938 RETVAL = (SMPEG_Info *) safemalloc (sizeof(SMPEG_Info));
2943 FreeSMPEGInfo ( info )
2949 SMPEGInfoHasAudio ( info )
2952 RETVAL = info->has_audio;
2957 SMPEGInfoHasVideo ( info )
2960 RETVAL = info->has_video;
2965 SMPEGInfoWidth ( info )
2968 RETVAL = info->width;
2973 SMPEGInfoHeight ( info )
2976 RETVAL = info->height;
2981 SMPEGInfoCurrentFrame ( info )
2984 RETVAL = info->current_frame;
2989 SMPEGInfoCurrentFPS ( info )
2992 RETVAL = info->current_fps;
2997 SMPEGInfoCurrentAudioFrame ( info )
3000 RETVAL = info->audio_current_frame;
3005 SMPEGInfoCurrentOffset ( info )
3008 RETVAL = info->current_offset;
3013 SMPEGInfoTotalSize ( info )
3016 RETVAL = info->total_size;
3021 SMPEGInfoCurrentTime ( info )
3024 RETVAL = info->current_time;
3029 SMPEGInfoTotalTime ( info )
3032 RETVAL = info->total_time;
3040 RETVAL = SMPEG_error(mpeg);
3045 NewSMPEG ( filename, info, use_audio )
3050 #ifdef HAVE_SDL_MIXER
3051 RETVAL = SMPEG_new(filename,info,0);
3053 RETVAL = SMPEG_new(filename,info,use_audio);
3065 SMPEGEnableAudio ( mpeg , flag )
3069 SMPEG_enableaudio(mpeg,flag);
3070 #ifdef HAVE_SDL_MIXER
3071 sdl_perl_use_smpeg_audio = flag;
3075 SMPEGEnableVideo ( mpeg , flag )
3079 SMPEG_enablevideo(mpeg,flag);
3082 SMPEGSetVolume ( mpeg , volume )
3086 SMPEG_setvolume(mpeg,volume);
3089 SMPEGSetDisplay ( mpeg, dest, surfLock )
3094 SMPEG_setdisplay(mpeg,dest,surfLock,NULL);
3097 SMPEGScaleXY ( mpeg, w, h)
3102 SMPEG_scaleXY(mpeg,w,h);
3105 SMPEGScale ( mpeg, scale )
3109 SMPEG_scale(mpeg,scale);
3115 SDL_AudioSpec audiofmt;
3118 #ifdef HAVE_SDL_MIXER
3119 if (sdl_perl_use_smpeg_audio ) {
3120 SMPEG_enableaudio(mpeg, 0);
3121 Mix_QuerySpec(&freq, &format, &channels);
3122 audiofmt.format = format;
3123 audiofmt.freq = freq;
3124 audiofmt.channels = channels;
3125 SMPEG_actualSpec(mpeg, &audiofmt);
3126 Mix_HookMusic(SMPEG_playAudioSDL, mpeg);
3127 SMPEG_enableaudio(mpeg, 1);
3133 SMPEGStatus ( mpeg )
3136 RETVAL = SMPEG_status(mpeg);
3147 SMPEGLoop ( mpeg, repeat )
3151 SMPEG_loop(mpeg,repeat);
3158 #ifdef HAVE_SDL_MIXER
3159 Mix_HookMusic(NULL, NULL);
3163 SMPEGRewind ( mpeg )
3169 SMPEGSeek ( mpeg, bytes )
3173 SMPEG_seek(mpeg,bytes);
3176 SMPEGSkip ( mpeg, seconds )
3180 SMPEG_skip(mpeg,seconds);
3183 SMPEGSetDisplayRegion ( mpeg, rect )
3187 SMPEG_setdisplayregion(mpeg,rect->x,rect->y,rect->w,rect->h);
3190 SMPEGRenderFrame ( mpeg, frame )
3194 SMPEG_renderFrame(mpeg,frame);
3197 SMPEGGetInfo ( mpeg )
3200 RETVAL = (SMPEG_Info *) safemalloc (sizeof(SMPEG_Info));
3201 SMPEG_getinfo(mpeg,RETVAL);
3213 GFXRotoZoom ( src, angle, zoom, smooth)
3219 RETVAL = rotozoomSurface( src, angle, zoom, smooth);
3224 GFXZoom ( src, zoomx, zoomy, smooth)
3230 RETVAL = zoomSurface( src, zoomx, zoomy, smooth);
3237 GFXPixelColor ( dst, x, y, color )
3243 RETVAL = pixelColor( dst, x, y, color);
3248 GFXPixelRGBA ( dst, x, y, r, g, b, a )
3257 RETVAL = pixelRGBA( dst, x, y, r, g, b, a );
3262 GFXHlineColor ( dst, x1, x2, y, color )
3269 RETVAL = hlineColor( dst, x1, x2, y, color );
3274 GFXHlineRGBA ( dst, x1, x2, y, r, g, b, a )
3284 RETVAL = hlineRGBA( dst, x1, x2, y, r, g, b, a );
3289 GFXVlineColor ( dst, x, y1, y2, color )
3296 RETVAL = vlineColor( dst, x, y1, y2, color );
3301 GFXVlineRGBA ( dst, x, y1, y2, r, g, b, a )
3311 RETVAL = vlineRGBA( dst, x, y1, y2, r, g, b, a );
3316 GFXRectangleColor ( dst, x1, y1, x2, y2, color )
3324 RETVAL = rectangleColor( dst, x1, y1, x2, y2, color );
3329 GFXRectangleRGBA ( dst, x1, y1, x2, y2, r, g, b, a )
3340 RETVAL = rectangleRGBA( dst, x1, y1, x2, y2, r, g, b, a );
3345 GFXBoxColor ( dst, x1, y1, x2, y2, color )
3353 RETVAL = boxColor( dst, x1, y1, x2, y2, color );
3358 GFXBoxRGBA ( dst, x1, y1, x2, y2, r, g, b, a )
3369 RETVAL = boxRGBA( dst, x1, y1, x2, y2, r, g, b, a );
3374 GFXLineColor ( dst, x1, y1, x2, y2, color )
3382 RETVAL = lineColor( dst, x1, y1, x2, y2, color );
3387 GFXLineRGBA ( dst, x1, y1, x2, y2, r, g, b, a )
3398 RETVAL = lineRGBA( dst, x1, y1, x2, y2, r, g, b, a );
3403 GFXAalineColor ( dst, x1, y1, x2, y2, color )
3411 RETVAL = aalineColor( dst, x1, y1, x2, y2, color );
3416 GFXAalineRGBA ( dst, x1, y1, x2, y2, r, g, b, a )
3427 RETVAL = aalineRGBA( dst, x1, y1, x2, y2, r, g, b, a );
3432 GFXCircleColor ( dst, x, y, r, color )
3439 RETVAL = circleColor( dst, x, y, r, color );
3444 GFXCircleRGBA ( dst, x, y, rad, r, g, b, a )
3454 RETVAL = circleRGBA( dst, x, y, rad, r, g, b, a );
3459 GFXAacircleColor ( dst, x, y, r, color )
3466 RETVAL = aacircleColor( dst, x, y, r, color );
3471 GFXAacircleRGBA ( dst, x, y, rad, r, g, b, a )
3481 RETVAL = aacircleRGBA( dst, x, y, rad, r, g, b, a );
3486 GFXFilledCircleColor ( dst, x, y, r, color )
3493 RETVAL = filledCircleColor( dst, x, y, r, color );
3498 GFXFilledCircleRGBA ( dst, x, y, rad, r, g, b, a )
3508 RETVAL = filledCircleRGBA( dst, x, y, rad, r, g, b, a );
3513 GFXEllipseColor ( dst, x, y, rx, ry, color )
3521 RETVAL = ellipseColor( dst, x, y, rx, ry, color );
3526 GFXEllipseRGBA ( dst, x, y, rx, ry, r, g, b, a )
3537 RETVAL = ellipseRGBA( dst, x, y, rx, ry, r, g, b, a );
3542 GFXAaellipseColor ( dst, xc, yc, rx, ry, color )
3550 RETVAL = aaellipseColor( dst, xc, yc, rx, ry, color );
3555 GFXAaellipseRGBA ( dst, x, y, rx, ry, r, g, b, a )
3566 RETVAL = aaellipseRGBA( dst, x, y, rx, ry, r, g, b, a );
3571 GFXFilledEllipseColor ( dst, x, y, rx, ry, color )
3579 RETVAL = filledEllipseColor( dst, x, y, rx, ry, color );
3584 GFXFilledEllipseRGBA ( dst, x, y, rx, ry, r, g, b, a )
3595 RETVAL = filledEllipseRGBA( dst, x, y, rx, ry, r, g, b, a );
3600 GFXFilledPieColor ( dst, x, y, rad, start, end, color )
3609 RETVAL = filledPieColor( dst, x, y, rad, start, end, color );
3614 GFXFilledPieRGBA ( dst, x, y, rad, start, end, r, g, b, a )
3626 RETVAL = filledPieRGBA( dst, x, y, rad, start, end, r, g, b, a );
3631 GFXPolygonColor ( dst, vx, vy, n, color )
3638 RETVAL = polygonColor( dst, vx, vy, n, color );
3643 GFXPolygonRGBA ( dst, vx, vy, n, r, g, b, a )
3653 RETVAL = polygonRGBA( dst, vx, vy, n, r, g, b, a );
3658 GFXAapolygonColor ( dst, vx, vy, n, color )
3665 RETVAL = aapolygonColor( dst, vx, vy, n, color );
3670 GFXAapolygonRGBA ( dst, vx, vy, n, r, g, b, a )
3680 RETVAL = aapolygonRGBA( dst, vx, vy, n, r, g, b, a );
3685 GFXFilledPolygonColor ( dst, vx, vy, n, color )
3692 RETVAL = filledPolygonColor( dst, vx, vy, n, color );
3697 GFXFilledPolygonRGBA ( dst, vx, vy, n, r, g, b, a )
3707 RETVAL = filledPolygonRGBA( dst, vx, vy, n, r, g, b, a );
3712 GFXCharacterColor ( dst, x, y, c, color )
3719 RETVAL = characterColor( dst, x, y, c, color );
3724 GFXCharacterRGBA ( dst, x, y, c, r, g, b, a )
3734 RETVAL = characterRGBA( dst, x, y, c, r, g, b, a );
3739 GFXStringColor ( dst, x, y, c, color )
3746 RETVAL = stringColor( dst, x, y, c, color );
3751 GFXStringRGBA ( dst, x, y, c, r, g, b, a )
3761 RETVAL = stringRGBA( dst, x, y, c, r, g, b, a );
3771 SVG_Load ( filename )
3774 RETVAL = SVG_Load(filename);
3779 SVG_LoadBuffer ( data, len )
3783 RETVAL = SVG_LoadBuffer(data,len);
3788 SVG_SetOffset ( source, xoff, yoff )
3789 SDL_svg_context* source
3793 RETVAL = SVG_SetOffset(source,xoff,yoff);
3798 SVG_SetScale ( source, xscale, yscale )
3799 SDL_svg_context* source
3803 RETVAL = SVG_SetScale(source,xscale,yscale);
3808 SVG_RenderToSurface ( source, x, y, dest )
3809 SDL_svg_context* source
3814 RETVAL = SVG_RenderToSurface(source,x,y,dest);
3820 SDL_svg_context* source
3825 SVG_Set_Flags ( source, flags )
3826 SDL_svg_context* source
3829 SVG_Set_Flags(source,flags);
3832 SVG_Width ( source )
3833 SDL_svg_context* source
3835 RETVAL = SVG_Width(source);
3840 SVG_HEIGHT ( source )
3841 SDL_svg_context* source
3843 RETVAL = SVG_Height(source);
3848 SVG_SetClipping ( source, minx, miny, maxx, maxy )
3849 SDL_svg_context* source
3855 SVG_SetClipping(source,minx,miny,maxx,maxy);
3860 RETVAL = SVG_Version();
3867 #ifdef HAVE_SDL_SOUND
3870 SoundAudioInfoFormat ( audioinfo )
3871 Sound_AudioInfo* audioinfo
3873 RETVAL = audioinfo->format;
3878 SoundAudioInfoChannels ( audioinfo )
3879 Sound_AudioInfo* audioinfo
3881 RETVAL = audioinfo->channels;
3886 SoundAudioInforate ( audioinfo )
3887 Sound_AudioInfo* audioinfo
3889 RETVAL = audioinfo->rate;
3894 SoundDecoderInfoExtensions ( decoderinfo )
3895 Sound_DecoderInfo* decoderinfo
3898 for ( ext = decoderinfo->extensions; *ext != NULL; ext++ ){
3899 av_push(RETVAL,newSVpv(*ext,0));
3905 SoundDecoderInfoDescription ( decoderinfo )
3906 Sound_DecoderInfo* decoderinfo
3908 RETVAL = decoderinfo->description;
3913 SoundDecoderInfoAuthor ( decoderinfo )
3914 Sound_DecoderInfo* decoderinfo
3916 RETVAL = decoderinfo->author;
3921 SoundDecoderInfoUrl ( decoderinfo )
3922 Sound_DecoderInfo* decoderinfo
3924 RETVAL = decoderinfo->url;
3928 const Sound_DecoderInfo*
3929 SoundSampleDecoder ( sample )
3930 Sound_Sample* sample
3932 RETVAL = sample->decoder;
3937 SoundSampleDesired ( sample )
3938 Sound_Sample* sample
3940 RETVAL = &sample->desired;
3945 SoundSampleAcutal ( sample )
3946 Sound_Sample* sample
3948 RETVAL = &sample->actual;
3953 SoundSampleBuffer ( sample )
3954 Sound_Sample* sample
3956 RETVAL = sample->buffer;
3961 SoundSampleBufferSize ( sample )
3962 Sound_Sample* sample
3964 RETVAL = sample->buffer_size;
3969 SoundSampleFlags ( sample )
3970 Sound_Sample* sample
3972 RETVAL = (Uint32)sample->flags;
3979 RETVAL = Sound_Init();
3986 RETVAL = Sound_Quit();
3991 Sound_AvailableDecoders ( )
3994 const Sound_DecoderInfo** sdi;
3995 sdi = Sound_AvailableDecoders();
3997 for (;*sdi != NULL; ++sdi) {
3998 av_push(RETVAL,sv_2mortal(newSViv(PTR2IV(*sdi))));
4007 RETVAL = Sound_GetError();
4012 Sound_ClearError ( )
4017 Sound_NewSample ( rw, ext, desired, buffsize )
4020 Sound_AudioInfo* desired
4023 RETVAL = Sound_NewSample(rw,ext,desired,buffsize);
4028 Sound_NewSampleFromMem ( data, size, ext, desired, buffsize )
4032 Sound_AudioInfo* desired
4035 RETVAL = Sound_NewSampleFromMem(data,size,ext,desired,buffsize);
4040 Sound_NewSampleFromFile ( fname, desired, buffsize )
4042 Sound_AudioInfo* desired
4045 RETVAL = Sound_NewSampleFromFile(fname,desired,buffsize);
4050 Sound_FreeSample ( sample )
4051 Sound_Sample* sample
4053 Sound_FreeSample(sample);
4056 Sound_GetDuration ( sample )
4057 Sound_Sample* sample
4059 RETVAL = Sound_GetDuration(sample);
4064 Sound_SetBufferSize ( sample, size )
4065 Sound_Sample* sample
4068 RETVAL = Sound_SetBufferSize(sample,size);
4073 Sound_Decode ( sample )
4074 Sound_Sample* sample
4076 RETVAL = Sound_Decode(sample);
4081 Sound_DecodeAll ( sample )
4082 Sound_Sample* sample
4084 RETVAL = Sound_DecodeAll(sample);
4089 Sound_Rewind ( sample )
4090 Sound_Sample* sample
4092 RETVAL = Sound_Rewind(sample);
4097 Sound_Seek ( sample, ms )
4098 Sound_Sample* sample
4101 RETVAL = Sound_Seek(sample,ms);
4112 RETVAL = TTF_Init();
4122 TTF_OpenFont ( file, ptsize )
4126 char* CLASS = "SDL::TTF_Font";
4127 RETVAL = TTF_OpenFont(file,ptsize);
4132 TTF_SizeText ( font, text )
4138 if(TTF_SizeText(font,text,&w,&h))
4140 printf("TTF error at TTFSizeText: %s \n", TTF_GetError());
4141 Perl_croak (aTHX_ "TTF error \n");
4145 av_push(RETVAL,newSViv(w));
4146 av_push(RETVAL,newSViv(h));
4147 sv_2mortal((SV*)RETVAL);
4153 TTF_RenderText_Blended ( font, text, fg )
4158 char* CLASS = "SDL::Surface";
4159 RETVAL = TTF_RenderText_Blended(font,text,*fg);
4165 MODULE = SDL PACKAGE = SDL
4166 PROTOTYPES : DISABLE