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 windows_force_driver ()
116 const SDL_version *version = SDL_Linked_Version();
117 if(version->patch == 14)
119 putenv("SDL_VIDEODRIVER=directx");
123 putenv("SDL_VIDEODRIVER=windib");
128 sdl_perl_timer_callback ( Uint32 interval, void* param )
141 XPUSHs(sv_2mortal(newSViv(interval)));
144 if (0 != (back = call_sv(cmd,G_SCALAR))) {
146 if (back != 1 ) Perl_croak (aTHX_ "Timer Callback failed!");
149 Perl_croak(aTHX_ "Timer Callback failed!");
161 sdl_perl_audio_callback ( void* data, Uint8 *stream, int len )
172 XPUSHs(sv_2mortal(newSViv(PTR2IV(stream))));
173 XPUSHs(sv_2mortal(newSViv(len)));
176 call_sv(cmd,G_VOID|G_DISCARD);
185 #ifdef HAVE_SDL_MIXER
188 sdl_perl_music_callback ( void )
194 cmd = (SV*)Mix_GetMusicHookData();
201 call_sv(cmd,G_VOID|G_DISCARD);
211 sdl_perl_music_finished_callback ( void )
217 cmd = (SV*)mix_music_finished_cv;
218 if ( cmd == NULL ) return;
225 call_sv(cmd,G_VOID|G_DISCARD);
236 #define INIT_NS_APPLICATION
237 #define QUIT_NS_APPLICATION
241 sdl_perl_atexit (void)
248 void boot_SDL__OpenGL();
256 MODULE = SDL_perl PACKAGE = SDL
262 RETVAL = SDL_GetError();
271 #if defined WINDOWS || WIN32
272 windows_force_driver();
274 RETVAL = SDL_Init(flags);
275 #ifdef HAVE_TLS_CONTEXT
276 Perl_call_atexit(PERL_GET_CONTEXT, (void*)sdl_perl_atexit,0);
278 atexit(sdl_perl_atexit);
284 init_subsystem ( flags )
287 RETVAL = SDL_InitSubSystem(flags);
292 quit_subsystem ( flags )
295 SDL_QuitSubSystem(flags);
307 RETVAL = SDL_WasInit(flags);
320 RETVAL = SDL_GetTicks();
325 SetTimer ( interval, callback )
327 SDL_TimerCallback callback
329 RETVAL = SDL_SetTimer(interval,callback);
334 AddTimer ( interval, callback, param )
336 SDL_NewTimerCallback callback
339 RETVAL = SDL_AddTimer(interval,callback,param);
346 RETVAL = sdl_perl_timer_callback;
351 NewTimer ( interval, cmd )
355 RETVAL = SDL_AddTimer(interval,sdl_perl_timer_callback,cmd);
363 RETVAL = SDL_RemoveTimer(id);
368 RWFromFile ( file, mode )
372 RETVAL = SDL_RWFromFile(file,mode);
377 RWFromFP ( fp, autoclose )
381 RETVAL = SDL_RWFromFP(fp,autoclose);
386 RWFromMem ( mem, size )
390 RETVAL = SDL_RWFromMem((void*)mem,size);
395 RWFromConstMem ( mem, size )
399 RETVAL = SDL_RWFromConstMem((const void*)mem,size);
406 RETVAL = SDL_AllocRW();
417 RWseek ( rw, off, whence )
422 RETVAL = SDL_RWseek(rw,off,whence);
430 RETVAL = SDL_RWtell(rw);
435 RWread ( rw, mem, size, n )
441 RETVAL = SDL_RWread(rw,mem,size,n);
446 RWwrite ( rw, mem, size, n )
452 RETVAL = SDL_RWwrite(rw,mem,size,n);
460 RETVAL = SDL_RWclose(rw);
467 RETVAL = SDL_CDNumDrives();
475 RETVAL = strdup(SDL_CDName(drive));
483 RETVAL = SDL_CDOpen(drive);
496 CDTrackType ( track )
499 RETVAL = track->type;
504 CDTrackLength ( track )
507 RETVAL = track->length;
512 CDTrackOffset ( track )
515 RETVAL = track->offset;
523 RETVAL = SDL_CDStatus(cd);
528 CDPlayTracks ( cd, start_track, ntracks, start_frame, nframes )
535 RETVAL = SDL_CDPlayTracks(cd,start_track,start_frame,ntracks,nframes);
540 CDPlay ( cd, start, length )
545 RETVAL = SDL_CDPlay(cd,start,length);
553 RETVAL = SDL_CDPause(cd);
561 RETVAL = SDL_CDResume(cd);
569 RETVAL = SDL_CDStop(cd);
577 RETVAL = SDL_CDEject(cd);
599 RETVAL = cd->numtracks;
607 RETVAL = cd->cur_track;
615 RETVAL = cd->cur_frame;
620 CDTrack ( cd, number )
624 RETVAL = (SDL_CDtrack *)(cd->track + number);
637 RETVAL = SDL_PushEvent( e );
644 RETVAL = (SDL_Event *) safemalloc (sizeof(SDL_Event));
658 RETVAL = SDL_PollEvent(e);
666 RETVAL = SDL_WaitEvent(e);
671 EventState ( type, state )
675 RETVAL = SDL_EventState(type,state);
688 SetEventType ( e, type )
698 ActiveEventGain ( e )
701 RETVAL = e->active.gain;
706 ActiveEventState ( e )
709 RETVAL = e->active.state;
717 RETVAL = e->key.state;
725 RETVAL = e->key.keysym.sym;
733 RETVAL = e->key.keysym.mod;
738 KeyEventUnicode ( e )
741 RETVAL = e->key.keysym.unicode;
749 RETVAL = e->key.keysym.scancode;
754 MouseMotionState ( e )
757 RETVAL = e->motion.state;
765 RETVAL = e->motion.x;
773 RETVAL = e->motion.y;
781 RETVAL = e->motion.xrel;
786 MouseMotionYrel ( e )
789 RETVAL = e->motion.yrel;
797 RETVAL = e->button.state;
805 RETVAL = e->button.button;
813 RETVAL = e->button.x;
821 RETVAL = e->button.y;
829 RETVAL = e->syswm.msg;
834 EnableUnicode ( enable )
837 RETVAL = SDL_EnableUNICODE(enable);
842 EnableKeyRepeat ( delay, interval )
846 SDL_EnableKeyRepeat(delay,interval);
851 RETVAL = SDL_GetModState();
856 SetModState ( state )
859 SDL_SetModState(state);
865 RETVAL = SDL_GetKeyName(sym);
869 #ifdef HAVE_SDL_IMAGE
872 IMG_Load ( filename )
875 char* CLASS = "SDL::Surface";
876 RETVAL = IMG_Load(filename);
884 Comment out for now as it does not compile
887 CreateRGBSurfaceFrom (pixels, width, height, depth, pitch, Rmask, Gmask, Bmask, Amask )
899 Uint32 len = pitch * height;
900 New(0,pixeldata,len,Uint8);
901 Copy(pixels,pixeldata,len,Uint8);
902 RETVAL = SDL_CreateRGBSurfaceFrom ( pixeldata, width, height,
903 depth, pitch, Rmask, Gmask, Bmask, Amask );
908 SurfaceCopy ( surface )
912 Uint32 size = surface->pitch * surface->h;
913 New(0,pixels,size,Uint8);
914 Copy(surface->pixels,pixels,size,Uint8);
915 RETVAL = SDL_CreateRGBSurfaceFrom(pixels,surface->w,surface->h,
916 surface->format->BitsPerPixel, surface->pitch,
917 surface->format->Rmask, surface->format->Gmask,
918 surface->format->Bmask, surface->format->Amask);
923 FreeSurface ( surface )
927 Uint8* pixels = surface->pixels;
928 Uint32 flags = surface->flags;
929 SDL_FreeSurface(surface);
930 if (flags & SDL_PREALLOC)
935 SurfaceFlags ( surface )
938 RETVAL = surface->flags;
943 SurfacePalette ( surface )
946 RETVAL = surface->format->palette;
951 SurfaceBitsPerPixel ( surface )
954 RETVAL = surface->format->BitsPerPixel;
959 SurfaceBytesPerPixel ( surface )
962 RETVAL = surface->format->BytesPerPixel;
967 SurfaceRshift ( surface )
970 RETVAL = surface->format->Rshift;
975 SurfaceGshift ( surface )
978 RETVAL = surface->format->Gshift;
983 SurfaceBshift ( surface )
986 RETVAL = surface->format->Bshift;
991 SurfaceAshift ( surface )
994 RETVAL = surface->format->Ashift;
999 SurfaceRmask( surface )
1000 SDL_Surface *surface
1002 RETVAL = surface->format->Rmask;
1007 SurfaceGmask ( surface )
1008 SDL_Surface *surface
1010 RETVAL = surface->format->Gmask;
1015 SurfaceBmask ( surface )
1016 SDL_Surface *surface
1018 RETVAL = surface->format->Bmask;
1023 SurfaceAmask ( surface )
1024 SDL_Surface *surface
1026 RETVAL = surface->format->Amask;
1031 SurfaceColorKey ( surface )
1032 SDL_Surface *surface
1034 RETVAL = surface->format->colorkey;
1039 SurfaceAlpha( surface )
1040 SDL_Surface *surface
1042 RETVAL = surface->format->alpha;
1047 SurfaceW ( surface )
1048 SDL_Surface *surface
1050 RETVAL = surface->w;
1055 SurfaceH ( surface )
1056 SDL_Surface *surface
1058 RETVAL = surface->h;
1063 SurfacePitch ( surface )
1064 SDL_Surface *surface
1066 RETVAL = surface->pitch;
1071 SurfacePixels ( surface )
1072 SDL_Surface *surface
1074 RETVAL = newSVpvn(surface->pixels,surface->pitch*surface->h);
1082 Comment out for now as it does not compile
1085 SurfacePixel ( surface, x, y, ... )
1086 SDL_Surface *surface
1093 int bpp = surface->format->BytesPerPixel;
1094 Uint8* p = (Uint8*)surface->pixels + bpp*x + surface->pitch*y;
1095 if ( items < 3 || items > 4 )
1096 Perl_croak(aTHX_ "usage: SDL::SurfacePixel(surface,x,y,[color])");
1098 color = (SDL_Color*)SvIV(ST(3));
1099 pix = SDL_MapRGB(surface->format,color->r,color->g,color->b);
1108 if (SDL_BYTEORDER == SDL_BIG_ENDIAN) {
1109 p[0] = (pix >> 16) & 0xff;
1110 p[1] = (pix >> 8) & 0xff;
1114 p[1] = (pix >> 8) & 0xff;
1115 p[2] = (pix >> 16) & 0xff;
1123 RETVAL = (SDL_Color *) safemalloc(sizeof(SDL_Color));
1127 memcpy(RETVAL,&surface->format->palette[index],sizeof(SDL_Color));
1131 SDL_GetRGB(pix,surface->format,&r,&g,&b);
1139 SDL_GetRGB(pix,surface->format,&r,&g,&b);
1149 MUSTLOCK ( surface )
1150 SDL_Surface *surface
1152 RETVAL = SDL_MUSTLOCK(surface);
1157 SurfaceLock ( surface )
1158 SDL_Surface *surface
1160 RETVAL = SDL_LockSurface(surface);
1165 SurfaceUnlock ( surface )
1166 SDL_Surface *surface
1168 SDL_UnlockSurface(surface);
1173 RETVAL = SDL_GetVideoSurface();
1183 SDL_VideoInfo *info;
1184 info = (SDL_VideoInfo *) safemalloc ( sizeof(SDL_VideoInfo));
1185 memcpy(info,SDL_GetVideoInfo(),sizeof(SDL_VideoInfo));
1187 hv_store(hv,"hw_available",strlen("hw_available"),
1188 newSViv(info->hw_available),0);
1189 hv_store(hv,"wm_available",strlen("wm_available"),
1190 newSViv(info->wm_available),0);
1191 hv_store(hv,"blit_hw",strlen("blit_hw"),
1192 newSViv(info->blit_hw),0);
1193 hv_store(hv,"blit_hw_CC",strlen("blit_hw_CC"),
1194 newSViv(info->blit_hw_CC),0);
1195 hv_store(hv,"blit_hw_A",strlen("blit_hw_A"),
1196 newSViv(info->blit_hw_A),0);
1197 hv_store(hv,"blit_sw",strlen("blit_sw"),
1198 newSViv(info->blit_sw),0);
1199 hv_store(hv,"blit_sw_CC",strlen("blit_sw_CC"),
1200 newSViv(info->blit_sw_CC),0);
1201 hv_store(hv,"blit_sw_A",strlen("blit_sw_A"),
1202 newSViv(info->blit_sw_A),0);
1203 hv_store(hv,"blit_fill",strlen("blit_fill"),
1204 newSViv(info->blit_fill),0);
1205 hv_store(hv,"video_mem",strlen("video_mem"),
1206 newSViv(info->video_mem),0);
1212 ListModes ( format, flags )
1214 SDL_PixelFormat *format
1218 mode = SDL_ListModes(format,flags);
1219 if (mode == (SDL_Rect**)-1 ) {
1220 av_push(RETVAL,newSVpv("all",0));
1221 } else if (! mode ) {
1222 av_push(RETVAL,newSVpv("none",0));
1224 for (;*mode;mode++) {
1225 av_push(RETVAL,newSViv(PTR2IV(*mode)));
1233 NewPalette ( number )
1236 RETVAL = (SDL_Palette *)safemalloc(sizeof(SDL_Palette));
1237 RETVAL->colors = (SDL_Color *)safemalloc(number *
1239 RETVAL->ncolors = number;
1245 PaletteNColors ( palette, ... )
1246 SDL_Palette *palette
1248 if ( items > 1 ) palette->ncolors = SvIV(ST(1));
1249 RETVAL = palette->ncolors;
1254 SetVideoMode ( width, height, bpp, flags )
1262 char *CLASS = "SDL::Surface";
1263 RETVAL = SDL_SetVideoMode(width,height,bpp,flags);
1269 SDL_Surface *surface
1271 RETVAL = SDL_Flip(surface);
1276 BlitSurface ( src, src_rect, dest, dest_rect )
1282 RETVAL = SDL_BlitSurface(src,src_rect,dest,dest_rect);
1287 MapRGB ( pixel_format, r, g, b )
1288 SDL_PixelFormat *pixel_format
1293 RETVAL = SDL_MapRGB(pixel_format,r,g,b);
1298 UpdateRect ( surface, x, y, w ,h )
1299 SDL_Surface *surface
1305 SDL_UpdateRect(surface,x,y,w,h);
1308 DisplayFormat ( surface )
1309 SDL_Surface *surface
1311 char* CLASS = "SDL::Surface";
1312 RETVAL = SDL_DisplayFormat(surface);
1317 DisplayFormatAlpha ( surface )
1318 SDL_Surface *surface
1320 char* CLASS = "SDL::Surface";
1321 RETVAL = SDL_DisplayFormatAlpha(surface);
1326 UpdateRects ( surface, ... )
1327 SDL_Surface *surface
1331 if ( items < 2 ) return;
1332 num_rects = items - 1;
1333 rects = (SDL_Rect *)safemalloc(sizeof(SDL_Rect)*items);
1334 for(i=0;i<num_rects;i++) {
1335 rects[i] = *(SDL_Rect *)SvIV((SV*)SvRV( ST(i + 1) ));
1337 SDL_UpdateRects(surface,num_rects,rects);
1342 Comment out for now as it does not compile
1345 VideoModeOK ( width, height, bpp, flags )
1351 RETVAL = SDL_VideoModeOK(width,height,bpp,flags);
1356 SetVideoMode ( width, height, bpp, flags )
1362 RETVAL = SDL_SetVideoMode(width,height,bpp,flags);
1368 SDL_Surface *surface
1370 RETVAL = SDL_Flip(surface);
1375 SetColors ( surface, start, ... )
1376 SDL_Surface *surface
1379 SDL_Color *colors,*temp;
1381 if ( items < 3 ) { RETVAL = 0; goto all_done; }
1383 colors = (SDL_Color *)safemalloc(sizeof(SDL_Color)*(length+1));
1384 for ( i = 0; i < length ; i++ ) {
1385 temp = (SDL_Color *)SvIV(ST(i+2));
1386 colors[i].r = temp->r;
1387 colors[i].g = temp->g;
1388 colors[i].b = temp->b;
1390 RETVAL = SDL_SetColors(surface, colors, start, length );
1397 MapRGBA ( surface, r, g, b, a )
1398 SDL_Surface *surface
1404 RETVAL = SDL_MapRGBA(surface->format,r,g,b,a);
1409 GetRGB ( surface, pixel )
1410 SDL_Surface *surface
1414 SDL_GetRGB(pixel,surface->format,&r,&g,&b);
1416 av_push(RETVAL,newSViv(r));
1417 av_push(RETVAL,newSViv(g));
1418 av_push(RETVAL,newSViv(b));
1423 GetRGBA ( surface, pixel )
1424 SDL_Surface *surface
1428 SDL_GetRGBA(pixel,surface->format,&r,&g,&b,&a);
1430 av_push(RETVAL,newSViv(r));
1431 av_push(RETVAL,newSViv(g));
1432 av_push(RETVAL,newSViv(b));
1433 av_push(RETVAL,newSViv(a));
1438 SaveBMP ( surface, filename )
1439 SDL_Surface *surface
1442 RETVAL = SDL_SaveBMP(surface,filename);
1447 SetColorKey ( surface, flag, key )
1448 SDL_Surface *surface
1452 Uint32 pixel = SDL_MapRGB(surface->format,key->r,key->g,key->b);
1453 RETVAL = SDL_SetColorKey(surface,flag,pixel);
1458 SetAlpha ( surface, flag, alpha )
1459 SDL_Surface *surface
1463 RETVAL = SDL_SetAlpha(surface,flag,alpha);
1468 ConvertRGB ( surface )
1469 SDL_Surface * surface
1471 SDL_PixelFormat fmt;
1473 fmt.BitsPerPixel = 24;
1474 fmt.BytesPerPixel = 3;
1475 fmt.Rmask = 0x000000ff;
1476 fmt.Gmask = 0x0000ff00;
1477 fmt.Bmask = 0x00ff0000;
1478 fmt.Amask = 0x00000000;
1489 RETVAL = SDL_ConvertSurface(surface,&fmt,surface->flags);
1494 ConvertRGBA ( surface )
1495 SDL_Surface * surface
1497 SDL_PixelFormat fmt;
1499 fmt.BitsPerPixel = 32;
1500 fmt.BytesPerPixel = 4;
1501 fmt.Rmask = 0x000000ff;
1502 fmt.Gmask = 0x0000ff00;
1503 fmt.Bmask = 0x00ff0000;
1504 fmt.Amask = 0xff000000;
1515 RETVAL = SDL_ConvertSurface(surface,&fmt,surface->flags);
1522 FillRect ( dest, dest_rect, pixel )
1527 RETVAL = SDL_FillRect(dest,dest_rect,pixel);
1534 RETVAL = SDL_GetAppState();
1540 WMSetCaption ( title, icon )
1544 SDL_WM_SetCaption(title,icon);
1550 SDL_WM_GetCaption(&title,&icon);
1552 av_push(RETVAL,newSVpv(title,0));
1553 av_push(RETVAL,newSVpv(icon,0));
1561 SDL_WM_SetIcon(icon,NULL);
1576 mask = SDL_GetMouseState(&x,&y);
1578 av_push(RETVAL,newSViv(mask));
1579 av_push(RETVAL,newSViv(x));
1580 av_push(RETVAL,newSViv(y));
1585 GetRelativeMouseState ()
1590 mask = SDL_GetRelativeMouseState(&x,&y);
1592 av_push(RETVAL,newSViv(mask));
1593 av_push(RETVAL,newSViv(x));
1594 av_push(RETVAL,newSViv(y));
1599 NewCursor ( data, mask, x ,y )
1605 RETVAL = SDL_CreateCursor((Uint8*)data->pixels,
1606 (Uint8*)mask->pixels,data->w,data->h,x,y);
1611 FreeCursor ( cursor )
1614 SDL_FreeCursor(cursor);
1617 SetCursor ( cursor )
1620 SDL_SetCursor(cursor);
1625 RETVAL = SDL_GetCursor();
1630 ShowCursor ( toggle )
1633 RETVAL = SDL_ShowCursor(toggle);
1638 NewAudioSpec ( freq, format, channels, samples )
1644 RETVAL = (SDL_AudioSpec *)safemalloc(sizeof(SDL_AudioSpec));
1645 RETVAL->freq = freq;
1646 RETVAL->format = format;
1647 RETVAL->channels = channels;
1648 RETVAL->samples = samples;
1653 FreeAudioSpec ( spec )
1659 NewAudioCVT ( src_format, src_channels, src_rate, dst_format, dst_channels, dst_rate)
1667 RETVAL = (SDL_AudioCVT *)safemalloc(sizeof(SDL_AudioCVT));
1668 if (SDL_BuildAudioCVT(RETVAL,src_format, src_channels, src_rate,
1669 dst_format, dst_channels, dst_rate)) {
1670 safefree(RETVAL); RETVAL = NULL; }
1675 FreeAudioCVT ( cvt )
1681 ConvertAudioData ( cvt, data, len )
1687 cvt->buf = (Uint8*) safemalloc(cvt->len*cvt->len_mult);
1688 memcpy(cvt->buf,data,cvt->len);
1689 RETVAL = SDL_ConvertAudio(cvt);
1694 OpenAudio ( spec, callback )
1698 spec->userdata = (void*)callback;
1699 spec->callback = sdl_perl_audio_callback;
1700 RETVAL = SDL_OpenAudio(spec,NULL);
1707 RETVAL = SDL_GetAudioStatus ();
1715 SDL_PauseAudio(p_on);
1739 LoadWAV ( filename, spec )
1743 SDL_AudioSpec *temp;
1748 temp = SDL_LoadWAV(filename,spec,&buf,&len);
1749 if ( ! temp ) goto error;
1750 av_push(RETVAL,newSViv(PTR2IV(temp)));
1751 av_push(RETVAL,newSViv(PTR2IV(buf)));
1752 av_push(RETVAL,newSViv(len));
1757 #ifdef HAVE_SDL_MIXER
1760 MixAudio ( dst, src, len, volume )
1766 SDL_MixAudio(dst,src,len,volume);
1769 MixOpenAudio ( frequency, format, channels, chunksize )
1775 RETVAL = Mix_OpenAudio(frequency, format, channels, chunksize);
1780 MixAllocateChannels ( number )
1783 RETVAL = Mix_AllocateChannels(number);
1790 int freq, channels, status;
1792 status = Mix_QuerySpec(&freq,&format,&channels);
1794 av_push(RETVAL,newSViv(status));
1795 av_push(RETVAL,newSViv(freq));
1796 av_push(RETVAL,newSViv(format));
1797 av_push(RETVAL,newSViv(channels));
1802 MixLoadWAV ( filename )
1805 RETVAL = Mix_LoadWAV(filename);
1810 MixLoadMusic ( filename )
1813 RETVAL = Mix_LoadMUS(filename);
1818 MixQuickLoadWAV ( buf )
1821 RETVAL = Mix_QuickLoad_WAV(buf);
1826 MixFreeChunk( chunk )
1829 Mix_FreeChunk(chunk);
1832 MixFreeMusic ( music )
1835 Mix_FreeMusic(music);
1838 MixSetPostMixCallback ( func, arg )
1842 Mix_SetPostMix(func,arg);
1847 RETVAL = sdl_perl_music_callback;
1852 MixSetMusicHook ( func, arg )
1856 Mix_HookMusic(func,arg);
1859 MixSetMusicFinishedHook ( func )
1862 mix_music_finished_cv = func;
1863 Mix_HookMusicFinished(sdl_perl_music_finished_callback);
1866 MixGetMusicHookData ()
1868 RETVAL = Mix_GetMusicHookData();
1873 MixReverseChannels ( number )
1876 RETVAL = Mix_ReserveChannels ( number );
1881 MixGroupChannel ( which, tag )
1885 RETVAL = Mix_GroupChannel(which,tag);
1890 MixGroupChannels ( from, to, tag )
1895 RETVAL = Mix_GroupChannels(from,to,tag);
1900 MixGroupAvailable ( tag )
1903 RETVAL = Mix_GroupAvailable(tag);
1908 MixGroupCount ( tag )
1911 RETVAL = Mix_GroupCount(tag);
1916 MixGroupOldest ( tag )
1919 RETVAL = Mix_GroupOldest(tag);
1924 MixGroupNewer ( tag )
1927 RETVAL = Mix_GroupNewer(tag);
1932 MixPlayChannel ( channel, chunk, loops )
1937 RETVAL = Mix_PlayChannel(channel,chunk,loops);
1942 MixPlayChannelTimed ( channel, chunk, loops, ticks )
1948 RETVAL = Mix_PlayChannelTimed(channel,chunk,loops,ticks);
1953 MixPlayMusic ( music, loops )
1957 RETVAL = Mix_PlayMusic(music,loops);
1962 MixFadeInChannel ( channel, chunk, loops, ms )
1968 RETVAL = Mix_FadeInChannel(channel,chunk,loops,ms);
1973 MixFadeInChannelTimed ( channel, chunk, loops, ms, ticks )
1980 RETVAL = Mix_FadeInChannelTimed(channel,chunk,loops,ms,ticks);
1985 MixFadeInMusic ( music, loops, ms )
1990 RETVAL = Mix_FadeInMusic(music,loops,ms);
1995 MixVolume ( channel, volume )
1999 RETVAL = Mix_Volume(channel,volume);
2004 MixVolumeChunk ( chunk, volume )
2008 RETVAL = Mix_VolumeChunk(chunk,volume);
2013 MixVolumeMusic ( volume )
2016 RETVAL = Mix_VolumeMusic(volume);
2021 MixHaltChannel ( channel )
2024 RETVAL = Mix_HaltChannel(channel);
2029 MixHaltGroup ( tag )
2032 RETVAL = Mix_HaltGroup(tag);
2039 RETVAL = Mix_HaltMusic();
2044 MixExpireChannel ( channel, ticks )
2048 RETVAL = Mix_ExpireChannel ( channel,ticks);
2053 MixFadeOutChannel ( which, ms )
2057 RETVAL = Mix_FadeOutChannel(which,ms);
2062 MixFadeOutGroup ( which, ms )
2066 RETVAL = Mix_FadeOutGroup(which,ms);
2071 MixFadeOutMusic ( ms )
2074 RETVAL = Mix_FadeOutMusic(ms);
2081 RETVAL = Mix_FadingMusic();
2086 MixFadingChannel( which )
2089 RETVAL = Mix_FadingChannel(which);
2094 MixPause ( channel )
2100 MixResume ( channel )
2103 Mix_Resume(channel);
2106 MixPaused ( channel )
2109 RETVAL = Mix_Paused(channel);
2131 RETVAL = Mix_PausedMusic();
2136 MixPlaying( channel )
2139 RETVAL = Mix_Playing(channel);
2146 RETVAL = Mix_PlayingMusic();
2151 MixSetPanning ( channel, left, right )
2156 RETVAL = Mix_SetPanning(channel, left, right);
2168 GLLoadLibrary ( path )
2171 RETVAL = SDL_GL_LoadLibrary(path);
2176 GLGetProcAddress ( proc )
2179 RETVAL = SDL_GL_GetProcAddress(proc);
2184 GLSetAttribute ( attr, value )
2188 RETVAL = SDL_GL_SetAttribute(attr, value);
2193 GLGetAttribute ( attr )
2198 av_push(RETVAL,newSViv(SDL_GL_GetAttribute(attr, &value)));
2199 av_push(RETVAL,newSViv(value));
2206 SDL_GL_SwapBuffers ();
2212 RETVAL = (SDL_BYTEORDER == SDL_BIG_ENDIAN);
2219 RETVAL = SDL_NumJoysticks();
2224 JoystickName ( index )
2227 RETVAL = (char*)SDL_JoystickName(index);
2232 JoystickOpen ( index )
2235 RETVAL = SDL_JoystickOpen(index);
2240 JoystickOpened ( index )
2243 RETVAL = SDL_JoystickOpened(index);
2248 JoystickIndex ( joystick )
2249 SDL_Joystick *joystick
2251 RETVAL = SDL_JoystickIndex(joystick);
2256 JoystickNumAxes ( joystick )
2257 SDL_Joystick *joystick
2259 RETVAL = SDL_JoystickNumAxes(joystick);
2264 JoystickNumBalls ( joystick )
2265 SDL_Joystick *joystick
2267 RETVAL = SDL_JoystickNumBalls(joystick);
2272 JoystickNumHats ( joystick )
2273 SDL_Joystick *joystick
2275 RETVAL = SDL_JoystickNumHats(joystick);
2280 JoystickNumButtons ( joystick )
2281 SDL_Joystick *joystick
2283 RETVAL = SDL_JoystickNumButtons(joystick);
2290 SDL_JoystickUpdate();
2293 JoystickGetAxis ( joystick, axis )
2294 SDL_Joystick *joystick
2297 RETVAL = SDL_JoystickGetAxis(joystick,axis);
2302 JoystickGetHat ( joystick, hat )
2303 SDL_Joystick *joystick
2306 RETVAL = SDL_JoystickGetHat(joystick,hat);
2311 JoystickGetButton ( joystick, button)
2312 SDL_Joystick *joystick
2315 RETVAL = SDL_JoystickGetButton(joystick,button);
2320 JoystickGetBall ( joystick, ball )
2321 SDL_Joystick *joystick
2325 success = SDL_JoystickGetBall(joystick,ball,&dx,&dy);
2327 av_push(RETVAL,newSViv(success));
2328 av_push(RETVAL,newSViv(dx));
2329 av_push(RETVAL,newSViv(dy));
2334 JoystickClose ( joystick )
2335 SDL_Joystick *joystick
2337 SDL_JoystickClose(joystick);
2340 JoyAxisEventWhich ( e )
2343 RETVAL = e->jaxis.which;
2348 JoyAxisEventAxis ( e )
2351 RETVAL = e->jaxis.axis;
2356 JoyAxisEventValue ( e )
2359 RETVAL = e->jaxis.value;
2364 JoyButtonEventWhich ( e )
2367 RETVAL = e->jbutton.which;
2372 JoyButtonEventButton ( e )
2375 RETVAL = e->jbutton.button;
2380 JoyButtonEventState ( e )
2383 RETVAL = e->jbutton.state;
2388 JoyHatEventWhich ( e )
2391 RETVAL = e->jhat.which;
2396 JoyHatEventHat ( e )
2399 RETVAL = e->jhat.hat;
2404 JoyHatEventValue ( e )
2407 RETVAL = e->jhat.value;
2412 JoyBallEventWhich ( e )
2415 RETVAL = e->jball.which;
2420 JoyBallEventBall ( e )
2423 RETVAL = e->jball.ball;
2428 JoyBallEventXrel ( e )
2431 RETVAL = e->jball.xrel;
2436 JoyBallEventYrel ( e )
2439 RETVAL = e->jball.yrel;
2444 SetClipRect ( surface, rect )
2445 SDL_Surface *surface
2448 SDL_SetClipRect(surface,rect);
2451 GetClipRect ( surface, rect )
2452 SDL_Surface *surface
2455 SDL_GetClipRect(surface, rect);
2463 RETVAL = SDLNet_Init();
2473 NetNewIPaddress ( host, port )
2477 RETVAL = (IPaddress*) safemalloc(sizeof(IPaddress));
2478 RETVAL->host = host;
2479 RETVAL->port = port;
2484 NetIPaddressHost ( ip )
2492 NetIPaddressPort ( ip )
2500 NetFreeIPaddress ( ip )
2506 NetResolveIP ( address )
2509 RETVAL = SDLNet_ResolveIP(address);
2514 NetResolveHost ( address, host, port )
2519 RETVAL = SDLNet_ResolveHost(address,host,port);
2527 RETVAL = SDLNet_TCP_Open(ip);
2532 NetTCPAccept ( server )
2535 RETVAL = SDLNet_TCP_Accept(server);
2540 NetTCPGetPeerAddress ( sock )
2543 RETVAL = SDLNet_TCP_GetPeerAddress(sock);
2548 NetTCPSend ( sock, data, len )
2553 RETVAL = SDLNet_TCP_Send(sock,data,len);
2558 NetTCPRecv ( sock, maxlen )
2564 buffer = safemalloc(maxlen);
2566 status = SDLNet_TCP_Recv(sock,buffer,maxlen);
2567 av_push(RETVAL,newSViv(status));
2568 av_push(RETVAL,newSVpvn((char*)buffer,maxlen));
2573 NetTCPClose ( sock )
2576 SDLNet_TCP_Close(sock);
2579 NetAllocPacket ( size )
2582 RETVAL = SDLNet_AllocPacket(size);
2587 NetAllocPacketV ( howmany, size )
2591 RETVAL = SDLNet_AllocPacketV(howmany,size);
2596 NetResizePacket ( packet, newsize )
2600 RETVAL = SDLNet_ResizePacket(packet,newsize);
2605 NetFreePacket ( packet )
2608 SDLNet_FreePacket(packet);
2611 NetFreePacketV ( packet )
2614 SDLNet_FreePacketV(packet);
2620 RETVAL = SDLNet_UDP_Open(port);
2625 NetUDPBind ( sock, channel, address )
2630 RETVAL = SDLNet_UDP_Bind(sock,channel,address);
2635 NetUDPUnbind ( sock, channel )
2639 SDLNet_UDP_Unbind(sock,channel);
2642 NetUDPGetPeerAddress ( sock, channel )
2646 RETVAL = SDLNet_UDP_GetPeerAddress(sock,channel);
2651 NetUDPSendV ( sock, packets, npackets )
2656 RETVAL = SDLNet_UDP_SendV(sock,packets,npackets);
2661 NetUDPSend ( sock, channel, packet )
2666 RETVAL = SDLNet_UDP_Send(sock,channel,packet);
2671 NetUDPRecvV ( sock, packets )
2675 RETVAL = SDLNet_UDP_RecvV(sock,packets);
2680 NetUDPRecv ( sock, packet )
2684 RETVAL = SDLNet_UDP_Recv(sock,packet);
2689 NetUDPClose ( sock )
2692 SDLNet_UDP_Close(sock);
2695 NetAllocSocketSet ( maxsockets )
2698 RETVAL = SDLNet_AllocSocketSet(maxsockets);
2703 NetTCP_AddSocket ( set, sock )
2704 SDLNet_SocketSet set
2707 RETVAL = SDLNet_TCP_AddSocket(set,sock);
2712 NetUDP_AddSocket ( set, sock )
2713 SDLNet_SocketSet set
2716 RETVAL = SDLNet_UDP_AddSocket(set,sock);
2721 NetTCP_DelSocket ( set, sock )
2722 SDLNet_SocketSet set
2725 RETVAL = SDLNet_TCP_DelSocket(set,sock);
2730 NetUDP_DelSocket ( set, sock )
2731 SDLNet_SocketSet set
2734 RETVAL = SDLNet_UDP_DelSocket(set,sock);
2739 NetCheckSockets ( set, timeout )
2740 SDLNet_SocketSet set
2743 RETVAL = SDLNet_CheckSockets(set,timeout);
2748 NetSocketReady ( sock )
2749 SDLNet_GenericSocket sock
2751 RETVAL = SDLNet_SocketReady(sock);
2756 NetFreeSocketSet ( set )
2757 SDLNet_SocketSet set
2759 SDLNet_FreeSocketSet(set);
2762 NetWrite16 ( value, area )
2766 SDLNet_Write16(value,area);
2769 NetWrite32 ( value, area )
2773 SDLNet_Write32(value,area);
2779 RETVAL = SDLNet_Read16(area);
2787 RETVAL = SDLNet_Read32(area);
2794 LockYUVOverlay ( overlay )
2795 SDL_Overlay *overlay
2797 RETVAL = SDL_LockYUVOverlay(overlay);
2802 UnlockYUVOverlay ( overlay )
2803 SDL_Overlay *overlay
2805 SDL_UnlockYUVOverlay(overlay);
2808 DisplayYUVOverlay ( overlay, dstrect )
2809 SDL_Overlay *overlay
2812 RETVAL = SDL_DisplayYUVOverlay ( overlay, dstrect );
2817 OverlayFormat ( overlay, ... )
2818 SDL_Overlay *overlay
2821 overlay->format = SvIV(ST(1));
2822 RETVAL = overlay->format;
2827 OverlayW ( overlay, ... )
2828 SDL_Overlay *overlay
2831 overlay->w = SvIV(ST(1));
2832 RETVAL = overlay->w;
2837 OverlayH ( overlay, ... )
2838 SDL_Overlay *overlay
2841 overlay->h = SvIV(ST(1));
2842 RETVAL = overlay->h;
2847 OverlayPlanes ( overlay, ... )
2848 SDL_Overlay *overlay
2851 overlay->planes = SvIV(ST(1));
2852 RETVAL = overlay->planes;
2857 OverlayHW ( overlay )
2858 SDL_Overlay *overlay
2860 RETVAL = overlay->hw_overlay;
2865 OverlayPitches ( overlay )
2866 SDL_Overlay *overlay
2868 RETVAL = overlay->pitches;
2873 OverlayPixels ( overlay )
2874 SDL_Overlay *overlay
2876 RETVAL = overlay->pixels;
2881 WMToggleFullScreen ( surface )
2882 SDL_Surface *surface
2884 RETVAL = SDL_WM_ToggleFullScreen(surface);
2889 WMGrabInput ( mode )
2892 RETVAL = SDL_WM_GrabInput(mode);
2899 RETVAL = SDL_WM_IconifyWindow();
2907 RETVAL = e->resize.w;
2915 RETVAL = e->resize.h;
2923 RETVAL = SDL_AudioDriverName(name,32);
2931 if (k >= SDLK_LAST) Perl_croak (aTHX_ "Key out of range");
2932 RETVAL = SDL_GetKeyState(NULL)[k];
2941 RETVAL = (SMPEG_Info *) safemalloc (sizeof(SMPEG_Info));
2946 FreeSMPEGInfo ( info )
2952 SMPEGInfoHasAudio ( info )
2955 RETVAL = info->has_audio;
2960 SMPEGInfoHasVideo ( info )
2963 RETVAL = info->has_video;
2968 SMPEGInfoWidth ( info )
2971 RETVAL = info->width;
2976 SMPEGInfoHeight ( info )
2979 RETVAL = info->height;
2984 SMPEGInfoCurrentFrame ( info )
2987 RETVAL = info->current_frame;
2992 SMPEGInfoCurrentFPS ( info )
2995 RETVAL = info->current_fps;
3000 SMPEGInfoCurrentAudioFrame ( info )
3003 RETVAL = info->audio_current_frame;
3008 SMPEGInfoCurrentOffset ( info )
3011 RETVAL = info->current_offset;
3016 SMPEGInfoTotalSize ( info )
3019 RETVAL = info->total_size;
3024 SMPEGInfoCurrentTime ( info )
3027 RETVAL = info->current_time;
3032 SMPEGInfoTotalTime ( info )
3035 RETVAL = info->total_time;
3043 RETVAL = SMPEG_error(mpeg);
3048 NewSMPEG ( filename, info, use_audio )
3053 #ifdef HAVE_SDL_MIXER
3054 RETVAL = SMPEG_new(filename,info,0);
3056 RETVAL = SMPEG_new(filename,info,use_audio);
3068 SMPEGEnableAudio ( mpeg , flag )
3072 SMPEG_enableaudio(mpeg,flag);
3073 #ifdef HAVE_SDL_MIXER
3074 sdl_perl_use_smpeg_audio = flag;
3078 SMPEGEnableVideo ( mpeg , flag )
3082 SMPEG_enablevideo(mpeg,flag);
3085 SMPEGSetVolume ( mpeg , volume )
3089 SMPEG_setvolume(mpeg,volume);
3092 SMPEGSetDisplay ( mpeg, dest, surfLock )
3097 SMPEG_setdisplay(mpeg,dest,surfLock,NULL);
3100 SMPEGScaleXY ( mpeg, w, h)
3105 SMPEG_scaleXY(mpeg,w,h);
3108 SMPEGScale ( mpeg, scale )
3112 SMPEG_scale(mpeg,scale);
3118 SDL_AudioSpec audiofmt;
3121 #ifdef HAVE_SDL_MIXER
3122 if (sdl_perl_use_smpeg_audio ) {
3123 SMPEG_enableaudio(mpeg, 0);
3124 Mix_QuerySpec(&freq, &format, &channels);
3125 audiofmt.format = format;
3126 audiofmt.freq = freq;
3127 audiofmt.channels = channels;
3128 SMPEG_actualSpec(mpeg, &audiofmt);
3129 Mix_HookMusic(SMPEG_playAudioSDL, mpeg);
3130 SMPEG_enableaudio(mpeg, 1);
3136 SMPEGStatus ( mpeg )
3139 RETVAL = SMPEG_status(mpeg);
3150 SMPEGLoop ( mpeg, repeat )
3154 SMPEG_loop(mpeg,repeat);
3161 #ifdef HAVE_SDL_MIXER
3162 Mix_HookMusic(NULL, NULL);
3166 SMPEGRewind ( mpeg )
3172 SMPEGSeek ( mpeg, bytes )
3176 SMPEG_seek(mpeg,bytes);
3179 SMPEGSkip ( mpeg, seconds )
3183 SMPEG_skip(mpeg,seconds);
3186 SMPEGSetDisplayRegion ( mpeg, rect )
3190 SMPEG_setdisplayregion(mpeg,rect->x,rect->y,rect->w,rect->h);
3193 SMPEGRenderFrame ( mpeg, frame )
3197 SMPEG_renderFrame(mpeg,frame);
3200 SMPEGGetInfo ( mpeg )
3203 RETVAL = (SMPEG_Info *) safemalloc (sizeof(SMPEG_Info));
3204 SMPEG_getinfo(mpeg,RETVAL);
3216 GFXRotoZoom ( src, angle, zoom, smooth)
3222 RETVAL = rotozoomSurface( src, angle, zoom, smooth);
3227 GFXZoom ( src, zoomx, zoomy, smooth)
3233 RETVAL = zoomSurface( src, zoomx, zoomy, smooth);
3240 GFXPixelColor ( dst, x, y, color )
3246 RETVAL = pixelColor( dst, x, y, color);
3251 GFXPixelRGBA ( dst, x, y, r, g, b, a )
3260 RETVAL = pixelRGBA( dst, x, y, r, g, b, a );
3265 GFXHlineColor ( dst, x1, x2, y, color )
3272 RETVAL = hlineColor( dst, x1, x2, y, color );
3277 GFXHlineRGBA ( dst, x1, x2, y, r, g, b, a )
3287 RETVAL = hlineRGBA( dst, x1, x2, y, r, g, b, a );
3292 GFXVlineColor ( dst, x, y1, y2, color )
3299 RETVAL = vlineColor( dst, x, y1, y2, color );
3304 GFXVlineRGBA ( dst, x, y1, y2, r, g, b, a )
3314 RETVAL = vlineRGBA( dst, x, y1, y2, r, g, b, a );
3319 GFXRectangleColor ( dst, x1, y1, x2, y2, color )
3327 RETVAL = rectangleColor( dst, x1, y1, x2, y2, color );
3332 GFXRectangleRGBA ( dst, x1, y1, x2, y2, r, g, b, a )
3343 RETVAL = rectangleRGBA( dst, x1, y1, x2, y2, r, g, b, a );
3348 GFXBoxColor ( dst, x1, y1, x2, y2, color )
3356 RETVAL = boxColor( dst, x1, y1, x2, y2, color );
3361 GFXBoxRGBA ( dst, x1, y1, x2, y2, r, g, b, a )
3372 RETVAL = boxRGBA( dst, x1, y1, x2, y2, r, g, b, a );
3377 GFXLineColor ( dst, x1, y1, x2, y2, color )
3385 RETVAL = lineColor( dst, x1, y1, x2, y2, color );
3390 GFXLineRGBA ( dst, x1, y1, x2, y2, r, g, b, a )
3401 RETVAL = lineRGBA( dst, x1, y1, x2, y2, r, g, b, a );
3406 GFXAalineColor ( dst, x1, y1, x2, y2, color )
3414 RETVAL = aalineColor( dst, x1, y1, x2, y2, color );
3419 GFXAalineRGBA ( dst, x1, y1, x2, y2, r, g, b, a )
3430 RETVAL = aalineRGBA( dst, x1, y1, x2, y2, r, g, b, a );
3435 GFXCircleColor ( dst, x, y, r, color )
3442 RETVAL = circleColor( dst, x, y, r, color );
3447 GFXCircleRGBA ( dst, x, y, rad, r, g, b, a )
3457 RETVAL = circleRGBA( dst, x, y, rad, r, g, b, a );
3462 GFXAacircleColor ( dst, x, y, r, color )
3469 RETVAL = aacircleColor( dst, x, y, r, color );
3474 GFXAacircleRGBA ( dst, x, y, rad, r, g, b, a )
3484 RETVAL = aacircleRGBA( dst, x, y, rad, r, g, b, a );
3489 GFXFilledCircleColor ( dst, x, y, r, color )
3496 RETVAL = filledCircleColor( dst, x, y, r, color );
3501 GFXFilledCircleRGBA ( dst, x, y, rad, r, g, b, a )
3511 RETVAL = filledCircleRGBA( dst, x, y, rad, r, g, b, a );
3516 GFXEllipseColor ( dst, x, y, rx, ry, color )
3524 RETVAL = ellipseColor( dst, x, y, rx, ry, color );
3529 GFXEllipseRGBA ( dst, x, y, rx, ry, r, g, b, a )
3540 RETVAL = ellipseRGBA( dst, x, y, rx, ry, r, g, b, a );
3545 GFXAaellipseColor ( dst, xc, yc, rx, ry, color )
3553 RETVAL = aaellipseColor( dst, xc, yc, rx, ry, color );
3558 GFXAaellipseRGBA ( dst, x, y, rx, ry, r, g, b, a )
3569 RETVAL = aaellipseRGBA( dst, x, y, rx, ry, r, g, b, a );
3574 GFXFilledEllipseColor ( dst, x, y, rx, ry, color )
3582 RETVAL = filledEllipseColor( dst, x, y, rx, ry, color );
3587 GFXFilledEllipseRGBA ( dst, x, y, rx, ry, r, g, b, a )
3598 RETVAL = filledEllipseRGBA( dst, x, y, rx, ry, r, g, b, a );
3603 GFXFilledPieColor ( dst, x, y, rad, start, end, color )
3612 RETVAL = filledPieColor( dst, x, y, rad, start, end, color );
3617 GFXFilledPieRGBA ( dst, x, y, rad, start, end, r, g, b, a )
3629 RETVAL = filledPieRGBA( dst, x, y, rad, start, end, r, g, b, a );
3634 GFXPolygonColor ( dst, vx, vy, n, color )
3641 RETVAL = polygonColor( dst, vx, vy, n, color );
3646 GFXPolygonRGBA ( dst, vx, vy, n, r, g, b, a )
3656 RETVAL = polygonRGBA( dst, vx, vy, n, r, g, b, a );
3661 GFXAapolygonColor ( dst, vx, vy, n, color )
3668 RETVAL = aapolygonColor( dst, vx, vy, n, color );
3673 GFXAapolygonRGBA ( dst, vx, vy, n, r, g, b, a )
3683 RETVAL = aapolygonRGBA( dst, vx, vy, n, r, g, b, a );
3688 GFXFilledPolygonColor ( dst, vx, vy, n, color )
3695 RETVAL = filledPolygonColor( dst, vx, vy, n, color );
3700 GFXFilledPolygonRGBA ( dst, vx, vy, n, r, g, b, a )
3710 RETVAL = filledPolygonRGBA( dst, vx, vy, n, r, g, b, a );
3715 GFXCharacterColor ( dst, x, y, c, color )
3722 RETVAL = characterColor( dst, x, y, c, color );
3727 GFXCharacterRGBA ( dst, x, y, c, r, g, b, a )
3737 RETVAL = characterRGBA( dst, x, y, c, r, g, b, a );
3742 GFXStringColor ( dst, x, y, c, color )
3749 RETVAL = stringColor( dst, x, y, c, color );
3754 GFXStringRGBA ( dst, x, y, c, r, g, b, a )
3764 RETVAL = stringRGBA( dst, x, y, c, r, g, b, a );
3774 SVG_Load ( filename )
3777 RETVAL = SVG_Load(filename);
3782 SVG_LoadBuffer ( data, len )
3786 RETVAL = SVG_LoadBuffer(data,len);
3791 SVG_SetOffset ( source, xoff, yoff )
3792 SDL_svg_context* source
3796 RETVAL = SVG_SetOffset(source,xoff,yoff);
3801 SVG_SetScale ( source, xscale, yscale )
3802 SDL_svg_context* source
3806 RETVAL = SVG_SetScale(source,xscale,yscale);
3811 SVG_RenderToSurface ( source, x, y, dest )
3812 SDL_svg_context* source
3817 RETVAL = SVG_RenderToSurface(source,x,y,dest);
3823 SDL_svg_context* source
3828 SVG_Set_Flags ( source, flags )
3829 SDL_svg_context* source
3832 SVG_Set_Flags(source,flags);
3835 SVG_Width ( source )
3836 SDL_svg_context* source
3838 RETVAL = SVG_Width(source);
3843 SVG_HEIGHT ( source )
3844 SDL_svg_context* source
3846 RETVAL = SVG_Height(source);
3851 SVG_SetClipping ( source, minx, miny, maxx, maxy )
3852 SDL_svg_context* source
3858 SVG_SetClipping(source,minx,miny,maxx,maxy);
3863 RETVAL = SVG_Version();
3870 #ifdef HAVE_SDL_SOUND
3873 SoundAudioInfoFormat ( audioinfo )
3874 Sound_AudioInfo* audioinfo
3876 RETVAL = audioinfo->format;
3881 SoundAudioInfoChannels ( audioinfo )
3882 Sound_AudioInfo* audioinfo
3884 RETVAL = audioinfo->channels;
3889 SoundAudioInforate ( audioinfo )
3890 Sound_AudioInfo* audioinfo
3892 RETVAL = audioinfo->rate;
3897 SoundDecoderInfoExtensions ( decoderinfo )
3898 Sound_DecoderInfo* decoderinfo
3901 for ( ext = decoderinfo->extensions; *ext != NULL; ext++ ){
3902 av_push(RETVAL,newSVpv(*ext,0));
3908 SoundDecoderInfoDescription ( decoderinfo )
3909 Sound_DecoderInfo* decoderinfo
3911 RETVAL = decoderinfo->description;
3916 SoundDecoderInfoAuthor ( decoderinfo )
3917 Sound_DecoderInfo* decoderinfo
3919 RETVAL = decoderinfo->author;
3924 SoundDecoderInfoUrl ( decoderinfo )
3925 Sound_DecoderInfo* decoderinfo
3927 RETVAL = decoderinfo->url;
3931 const Sound_DecoderInfo*
3932 SoundSampleDecoder ( sample )
3933 Sound_Sample* sample
3935 RETVAL = sample->decoder;
3940 SoundSampleDesired ( sample )
3941 Sound_Sample* sample
3943 RETVAL = &sample->desired;
3948 SoundSampleAcutal ( sample )
3949 Sound_Sample* sample
3951 RETVAL = &sample->actual;
3956 SoundSampleBuffer ( sample )
3957 Sound_Sample* sample
3959 RETVAL = sample->buffer;
3964 SoundSampleBufferSize ( sample )
3965 Sound_Sample* sample
3967 RETVAL = sample->buffer_size;
3972 SoundSampleFlags ( sample )
3973 Sound_Sample* sample
3975 RETVAL = (Uint32)sample->flags;
3982 RETVAL = Sound_Init();
3989 RETVAL = Sound_Quit();
3994 Sound_AvailableDecoders ( )
3997 const Sound_DecoderInfo** sdi;
3998 sdi = Sound_AvailableDecoders();
4000 for (;*sdi != NULL; ++sdi) {
4001 av_push(RETVAL,sv_2mortal(newSViv(PTR2IV(*sdi))));
4010 RETVAL = Sound_GetError();
4015 Sound_ClearError ( )
4020 Sound_NewSample ( rw, ext, desired, buffsize )
4023 Sound_AudioInfo* desired
4026 RETVAL = Sound_NewSample(rw,ext,desired,buffsize);
4031 Sound_NewSampleFromMem ( data, size, ext, desired, buffsize )
4035 Sound_AudioInfo* desired
4038 RETVAL = Sound_NewSampleFromMem(data,size,ext,desired,buffsize);
4043 Sound_NewSampleFromFile ( fname, desired, buffsize )
4045 Sound_AudioInfo* desired
4048 RETVAL = Sound_NewSampleFromFile(fname,desired,buffsize);
4053 Sound_FreeSample ( sample )
4054 Sound_Sample* sample
4056 Sound_FreeSample(sample);
4059 Sound_GetDuration ( sample )
4060 Sound_Sample* sample
4062 RETVAL = Sound_GetDuration(sample);
4067 Sound_SetBufferSize ( sample, size )
4068 Sound_Sample* sample
4071 RETVAL = Sound_SetBufferSize(sample,size);
4076 Sound_Decode ( sample )
4077 Sound_Sample* sample
4079 RETVAL = Sound_Decode(sample);
4084 Sound_DecodeAll ( sample )
4085 Sound_Sample* sample
4087 RETVAL = Sound_DecodeAll(sample);
4092 Sound_Rewind ( sample )
4093 Sound_Sample* sample
4095 RETVAL = Sound_Rewind(sample);
4100 Sound_Seek ( sample, ms )
4101 Sound_Sample* sample
4104 RETVAL = Sound_Seek(sample,ms);
4115 RETVAL = TTF_Init();
4125 TTF_OpenFont ( file, ptsize )
4129 char* CLASS = "SDL::TTF_Font";
4130 RETVAL = TTF_OpenFont(file,ptsize);
4135 TTF_SizeText ( font, text )
4141 if(TTF_SizeText(font,text,&w,&h))
4143 printf("TTF error at TTFSizeText: %s \n", TTF_GetError());
4144 Perl_croak (aTHX_ "TTF error \n");
4148 av_push(RETVAL,newSViv(w));
4149 av_push(RETVAL,newSViv(h));
4150 sv_2mortal((SV*)RETVAL);
4156 TTF_RenderText_Blended ( font, text, fg )
4161 char* CLASS = "SDL::Surface";
4162 RETVAL = TTF_RenderText_Blended(font,text,*fg);
4168 MODULE = SDL PACKAGE = SDL
4169 PROTOTYPES : DISABLE