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>
69 #define TEXT_BLENDED 4
71 #define UTF8_SHADED 16
72 #define UTF8_BLENDED 32
73 #define UNICODE_SOLID 64
74 #define UNICODE_SHADED 128
75 #define UNICODE_BLENDED 256
79 #include <smpeg/smpeg.h>
81 static int sdl_perl_use_smpeg_audio = 0;
86 #include <SDL_rotozoom.h>
87 #include <SDL_gfxPrimitives.h>
88 #include <SDL_framerate.h>
89 #include <SDL_imageFilter.h>
97 #define HAVE_TLS_CONTEXT
103 sdl_perl_timer_callback ( Uint32 interval, void* param )
116 XPUSHs(sv_2mortal(newSViv(interval)));
119 if (0 != (back = call_sv(cmd,G_SCALAR))) {
121 if (back != 1 ) Perl_croak (aTHX_ "Timer Callback failed!");
124 Perl_croak(aTHX_ "Timer Callback failed!");
136 sdl_perl_audio_callback ( void* data, Uint8 *stream, int len )
147 XPUSHs(sv_2mortal(newSViv(PTR2IV(stream))));
148 XPUSHs(sv_2mortal(newSViv(len)));
151 call_sv(cmd,G_VOID|G_DISCARD);
160 #ifdef HAVE_SDL_MIXER
163 sdl_perl_music_callback ( void )
169 cmd = (SV*)Mix_GetMusicHookData();
176 call_sv(cmd,G_VOID|G_DISCARD);
186 sdl_perl_music_finished_callback ( void )
192 cmd = (SV*)mix_music_finished_cv;
193 if ( cmd == NULL ) return;
200 call_sv(cmd,G_VOID|G_DISCARD);
211 #define INIT_NS_APPLICATION
212 #define QUIT_NS_APPLICATION
216 sdl_perl_atexit (void)
223 void boot_SDL__OpenGL();
231 MODULE = SDL_perl PACKAGE = SDL
237 RETVAL = SDL_GetError();
246 RETVAL = SDL_Init(flags);
247 #ifdef HAVE_TLS_CONTEXT
248 Perl_call_atexit(PERL_GET_CONTEXT, (void*)sdl_perl_atexit,0);
250 atexit(sdl_perl_atexit);
256 InitSubSystem ( flags )
259 RETVAL = SDL_InitSubSystem(flags);
264 QuitSubSystem ( flags )
267 SDL_QuitSubSystem(flags);
279 RETVAL = SDL_WasInit(flags);
292 RETVAL = SDL_GetTicks();
297 SetTimer ( interval, callback )
299 SDL_TimerCallback callback
301 RETVAL = SDL_SetTimer(interval,callback);
306 AddTimer ( interval, callback, param )
308 SDL_NewTimerCallback callback
311 RETVAL = SDL_AddTimer(interval,callback,param);
318 RETVAL = sdl_perl_timer_callback;
323 NewTimer ( interval, cmd )
327 RETVAL = SDL_AddTimer(interval,sdl_perl_timer_callback,cmd);
335 RETVAL = SDL_RemoveTimer(id);
340 RWFromFile ( file, mode )
344 RETVAL = SDL_RWFromFile(file,mode);
349 RWFromFP ( fp, autoclose )
353 RETVAL = SDL_RWFromFP(fp,autoclose);
358 RWFromMem ( mem, size )
362 RETVAL = SDL_RWFromMem((void*)mem,size);
367 RWFromConstMem ( mem, size )
371 RETVAL = SDL_RWFromConstMem((const void*)mem,size);
378 RETVAL = SDL_AllocRW();
389 RWseek ( rw, off, whence )
394 RETVAL = SDL_RWseek(rw,off,whence);
402 RETVAL = SDL_RWtell(rw);
407 RWread ( rw, mem, size, n )
413 RETVAL = SDL_RWread(rw,mem,size,n);
418 RWwrite ( rw, mem, size, n )
424 RETVAL = SDL_RWwrite(rw,mem,size,n);
432 RETVAL = SDL_RWclose(rw);
439 RETVAL = SDL_CDNumDrives();
447 RETVAL = strdup(SDL_CDName(drive));
455 RETVAL = SDL_CDOpen(drive);
468 CDTrackType ( track )
471 RETVAL = track->type;
476 CDTrackLength ( track )
479 RETVAL = track->length;
484 CDTrackOffset ( track )
487 RETVAL = track->offset;
495 RETVAL = SDL_CDStatus(cd);
500 CDPlayTracks ( cd, start_track, ntracks, start_frame, nframes )
507 RETVAL = SDL_CDPlayTracks(cd,start_track,start_frame,ntracks,nframes);
512 CDPlay ( cd, start, length )
517 RETVAL = SDL_CDPlay(cd,start,length);
525 RETVAL = SDL_CDPause(cd);
533 RETVAL = SDL_CDResume(cd);
541 RETVAL = SDL_CDStop(cd);
549 RETVAL = SDL_CDEject(cd);
571 RETVAL = cd->numtracks;
579 RETVAL = cd->cur_track;
587 RETVAL = cd->cur_frame;
592 CDTrack ( cd, number )
596 RETVAL = (SDL_CDtrack *)(cd->track + number);
609 RETVAL = SDL_PushEvent( e );
616 RETVAL = (SDL_Event *) safemalloc (sizeof(SDL_Event));
630 RETVAL = SDL_PollEvent(e);
638 RETVAL = SDL_WaitEvent(e);
643 EventState ( type, state )
647 RETVAL = SDL_EventState(type,state);
660 SetEventType ( e, type )
670 ActiveEventGain ( e )
673 RETVAL = e->active.gain;
678 ActiveEventState ( e )
681 RETVAL = e->active.state;
689 RETVAL = e->key.state;
697 RETVAL = e->key.keysym.sym;
705 RETVAL = e->key.keysym.mod;
710 KeyEventUnicode ( e )
713 RETVAL = e->key.keysym.unicode;
718 KeyEventScanCode ( e )
721 RETVAL = e->key.keysym.scancode;
726 MouseMotionState ( e )
729 RETVAL = e->motion.state;
737 RETVAL = e->motion.x;
745 RETVAL = e->motion.y;
753 RETVAL = e->motion.xrel;
758 MouseMotionYrel ( e )
761 RETVAL = e->motion.yrel;
766 MouseButtonState ( e )
769 RETVAL = e->button.state;
777 RETVAL = e->button.button;
785 RETVAL = e->button.x;
793 RETVAL = e->button.y;
801 RETVAL = e->syswm.msg;
806 EnableUnicode ( enable )
809 RETVAL = SDL_EnableUNICODE(enable);
814 EnableKeyRepeat ( delay, interval )
818 SDL_EnableKeyRepeat(delay,interval);
823 RETVAL = SDL_GetModState();
828 SetModState ( state )
831 SDL_SetModState(state);
837 RETVAL = SDL_GetKeyName(sym);
842 CreateRGBSurface (flags, width, height, depth, Rmask, Gmask, Bmask, Amask )
852 RETVAL = SDL_CreateRGBSurface ( flags, width, height,
853 depth, Rmask, Gmask, Bmask, Amask );
859 CreateRGBSurfaceFrom (pixels, width, height, depth, pitch, Rmask, Gmask, Bmask, Amask )
871 Uint32 len = pitch * height;
872 New(0,pixeldata,len,Uint8);
873 Copy(pixels,pixeldata,len,Uint8);
874 RETVAL = SDL_CreateRGBSurfaceFrom ( pixeldata, width, height,
875 depth, pitch, Rmask, Gmask, Bmask, Amask );
879 #ifdef HAVE_SDL_IMAGE
885 RETVAL = IMG_Load(fname);
892 SurfaceCopy ( surface )
896 Uint32 size = surface->pitch * surface->h;
897 New(0,pixels,size,Uint8);
898 Copy(surface->pixels,pixels,size,Uint8);
899 RETVAL = SDL_CreateRGBSurfaceFrom(pixels,surface->w,surface->h,
900 surface->format->BitsPerPixel, surface->pitch,
901 surface->format->Rmask, surface->format->Gmask,
902 surface->format->Bmask, surface->format->Amask);
907 FreeSurface ( surface )
911 Uint8* pixels = surface->pixels;
912 Uint32 flags = surface->flags;
913 SDL_FreeSurface(surface);
914 if (flags & SDL_PREALLOC)
919 SurfaceFlags ( surface )
922 RETVAL = surface->flags;
927 SurfacePalette ( surface )
930 RETVAL = surface->format->palette;
935 SurfaceBitsPerPixel ( surface )
938 RETVAL = surface->format->BitsPerPixel;
943 SurfaceBytesPerPixel ( surface )
946 RETVAL = surface->format->BytesPerPixel;
951 SurfaceRshift ( surface )
954 RETVAL = surface->format->Rshift;
959 SurfaceGshift ( surface )
962 RETVAL = surface->format->Gshift;
967 SurfaceBshift ( surface )
970 RETVAL = surface->format->Bshift;
975 SurfaceAshift ( surface )
978 RETVAL = surface->format->Ashift;
983 SurfaceRmask( surface )
986 RETVAL = surface->format->Rmask;
991 SurfaceGmask ( surface )
994 RETVAL = surface->format->Gmask;
999 SurfaceBmask ( surface )
1000 SDL_Surface *surface
1002 RETVAL = surface->format->Bmask;
1007 SurfaceAmask ( surface )
1008 SDL_Surface *surface
1010 RETVAL = surface->format->Amask;
1015 SurfaceColorKey ( surface )
1016 SDL_Surface *surface
1018 RETVAL = surface->format->colorkey;
1023 SurfaceAlpha( surface )
1024 SDL_Surface *surface
1026 RETVAL = surface->format->alpha;
1031 SurfaceW ( surface )
1032 SDL_Surface *surface
1034 RETVAL = surface->w;
1039 SurfaceH ( surface )
1040 SDL_Surface *surface
1042 RETVAL = surface->h;
1047 SurfacePitch ( surface )
1048 SDL_Surface *surface
1050 RETVAL = surface->pitch;
1055 SurfacePixels ( surface )
1056 SDL_Surface *surface
1058 RETVAL = newSVpvn(surface->pixels,surface->pitch*surface->h);
1063 SurfacePixel ( surface, x, y, ... )
1064 SDL_Surface *surface
1071 int bpp = surface->format->BytesPerPixel;
1072 Uint8* p = (Uint8*)surface->pixels + bpp*x + surface->pitch*y;
1073 if ( items < 3 || items > 4 )
1074 Perl_croak(aTHX_ "usage: SDL::SurfacePixel(surface,x,y,[color])");
1076 color = (SDL_Color*)SvIV(ST(3));
1077 pix = SDL_MapRGB(surface->format,color->r,color->g,color->b);
1086 if (SDL_BYTEORDER == SDL_BIG_ENDIAN) {
1087 p[0] = (pix >> 16) & 0xff;
1088 p[1] = (pix >> 8) & 0xff;
1092 p[1] = (pix >> 8) & 0xff;
1093 p[2] = (pix >> 16) & 0xff;
1101 RETVAL = (SDL_Color *) safemalloc(sizeof(SDL_Color));
1105 memcpy(RETVAL,&surface->format->palette[index],sizeof(SDL_Color));
1109 SDL_GetRGB(pix,surface->format,&r,&g,&b);
1117 SDL_GetRGB(pix,surface->format,&r,&g,&b);
1127 MUSTLOCK ( surface )
1128 SDL_Surface *surface
1130 RETVAL = SDL_MUSTLOCK(surface);
1135 SurfaceLock ( surface )
1136 SDL_Surface *surface
1138 RETVAL = SDL_LockSurface(surface);
1143 SurfaceUnlock ( surface )
1144 SDL_Surface *surface
1146 SDL_UnlockSurface(surface);
1151 RETVAL = SDL_GetVideoSurface();
1160 SDL_VideoInfo *info;
1161 info = (SDL_VideoInfo *) safemalloc ( sizeof(SDL_VideoInfo));
1162 memcpy(info,SDL_GetVideoInfo(),sizeof(SDL_VideoInfo));
1164 hv_store(hv,"hw_available",strlen("hw_available"),
1165 newSViv(info->hw_available),0);
1166 hv_store(hv,"wm_available",strlen("wm_available"),
1167 newSViv(info->wm_available),0);
1168 hv_store(hv,"blit_hw",strlen("blit_hw"),
1169 newSViv(info->blit_hw),0);
1170 hv_store(hv,"blit_hw_CC",strlen("blit_hw_CC"),
1171 newSViv(info->blit_hw_CC),0);
1172 hv_store(hv,"blit_hw_A",strlen("blit_hw_A"),
1173 newSViv(info->blit_hw_A),0);
1174 hv_store(hv,"blit_sw",strlen("blit_sw"),
1175 newSViv(info->blit_sw),0);
1176 hv_store(hv,"blit_sw_CC",strlen("blit_sw_CC"),
1177 newSViv(info->blit_sw_CC),0);
1178 hv_store(hv,"blit_sw_A",strlen("blit_sw_A"),
1179 newSViv(info->blit_sw_A),0);
1180 hv_store(hv,"blit_fill",strlen("blit_fill"),
1181 newSViv(info->blit_fill),0);
1182 hv_store(hv,"video_mem",strlen("video_mem"),
1183 newSViv(info->video_mem),0);
1189 NewRect ( x, y, w, h )
1195 RETVAL = (SDL_Rect *) safemalloc (sizeof(SDL_Rect));
1213 if (items > 1 ) rect->x = SvIV(ST(1));
1222 if (items > 1 ) rect->y = SvIV(ST(1));
1231 if (items > 1 ) rect->w = SvIV(ST(1));
1240 if (items > 1 ) rect->h = SvIV(ST(1));
1246 ListModes ( format, flags )
1248 SDL_PixelFormat *format
1252 mode = SDL_ListModes(format,flags);
1253 if (mode == (SDL_Rect**)-1 ) {
1254 av_push(RETVAL,newSVpv("all",0));
1255 } else if (! mode ) {
1256 av_push(RETVAL,newSVpv("none",0));
1258 for (;*mode;mode++) {
1259 av_push(RETVAL,newSViv(PTR2IV(*mode)));
1267 NewColor ( r, g, b )
1272 RETVAL = (SDL_Color *) safemalloc(sizeof(SDL_Color));
1280 ColorR ( color, ... )
1283 if (items > 1 ) color->r = SvIV(ST(1));
1289 ColorG ( color, ... )
1292 if (items > 1 ) color->g = SvIV(ST(1));
1298 ColorB ( color, ... )
1301 if (items > 1 ) color->b = SvIV(ST(1));
1310 return; safefree(color);
1313 NewPalette ( number )
1316 RETVAL = (SDL_Palette *)safemalloc(sizeof(SDL_Palette));
1317 RETVAL->colors = (SDL_Color *)safemalloc(number *
1319 RETVAL->ncolors = number;
1324 PaletteNColors ( palette, ... )
1325 SDL_Palette *palette
1327 if ( items > 1 ) palette->ncolors = SvIV(ST(1));
1328 RETVAL = palette->ncolors;
1333 PaletteColors ( palette, index, ... )
1334 SDL_Palette *palette
1338 palette->colors[index].r = SvUV(ST(2));
1339 palette->colors[index].g = SvUV(ST(3));
1340 palette->colors[index].b = SvUV(ST(4));
1342 RETVAL = (SDL_Color *)(palette->colors + index);
1347 VideoModeOK ( width, height, bpp, flags )
1353 RETVAL = SDL_VideoModeOK(width,height,bpp,flags);
1358 SetVideoMode ( width, height, bpp, flags )
1364 RETVAL = SDL_SetVideoMode(width,height,bpp,flags);
1369 UpdateRect ( surface, x, y, w ,h )
1370 SDL_Surface *surface
1376 SDL_UpdateRect(surface,x,y,w,h);
1379 UpdateRects ( surface, ... )
1380 SDL_Surface *surface
1382 SDL_Rect *rects, *temp;
1384 if ( items < 2 ) return;
1385 num_rects = items - 1;
1386 rects = (SDL_Rect *)safemalloc(sizeof(SDL_Rect)*items);
1387 for(i=0;i<num_rects;i++) {
1388 temp = (SDL_Rect *)SvIV(ST(i+1));
1389 rects[i].x = temp->x;
1390 rects[i].y = temp->y;
1391 rects[i].w = temp->w;
1392 rects[i].h = temp->h;
1394 SDL_UpdateRects(surface,num_rects,rects);
1399 SDL_Surface *surface
1401 RETVAL = SDL_Flip(surface);
1406 SetColors ( surface, start, ... )
1407 SDL_Surface *surface
1410 SDL_Color *colors,*temp;
1412 if ( items < 3 ) { RETVAL = 0; goto all_done; }
1414 colors = (SDL_Color *)safemalloc(sizeof(SDL_Color)*(length+1));
1415 for ( i = 0; i < length ; i++ ) {
1416 temp = (SDL_Color *)SvIV(ST(i+2));
1417 colors[i].r = temp->r;
1418 colors[i].g = temp->g;
1419 colors[i].b = temp->b;
1421 RETVAL = SDL_SetColors(surface, colors, start, length );
1428 MapRGB ( surface, r, g, b )
1429 SDL_Surface *surface
1434 RETVAL = SDL_MapRGB(surface->format,r,g,b);
1439 MapRGBA ( surface, r, g, b, a )
1440 SDL_Surface *surface
1446 RETVAL = SDL_MapRGBA(surface->format,r,g,b,a);
1451 GetRGB ( surface, pixel )
1452 SDL_Surface *surface
1456 SDL_GetRGB(pixel,surface->format,&r,&g,&b);
1458 av_push(RETVAL,newSViv(r));
1459 av_push(RETVAL,newSViv(g));
1460 av_push(RETVAL,newSViv(b));
1465 GetRGBA ( surface, pixel )
1466 SDL_Surface *surface
1470 SDL_GetRGBA(pixel,surface->format,&r,&g,&b,&a);
1472 av_push(RETVAL,newSViv(r));
1473 av_push(RETVAL,newSViv(g));
1474 av_push(RETVAL,newSViv(b));
1475 av_push(RETVAL,newSViv(a));
1480 SaveBMP ( surface, filename )
1481 SDL_Surface *surface
1484 RETVAL = SDL_SaveBMP(surface,filename);
1489 SetColorKey ( surface, flag, key )
1490 SDL_Surface *surface
1494 Uint32 pixel = SDL_MapRGB(surface->format,key->r,key->g,key->b);
1495 RETVAL = SDL_SetColorKey(surface,flag,pixel);
1500 SetAlpha ( surface, flag, alpha )
1501 SDL_Surface *surface
1505 RETVAL = SDL_SetAlpha(surface,flag,alpha);
1510 DisplayFormat ( surface )
1511 SDL_Surface *surface
1513 RETVAL = SDL_DisplayFormat(surface);
1518 DisplayFormatAlpha ( surface )
1519 SDL_Surface *surface
1521 RETVAL = SDL_DisplayFormatAlpha(surface);
1526 ConvertRGB ( surface )
1527 SDL_Surface * surface
1529 SDL_PixelFormat fmt;
1531 fmt.BitsPerPixel = 24;
1532 fmt.BytesPerPixel = 3;
1533 fmt.Rmask = 0x000000ff;
1534 fmt.Gmask = 0x0000ff00;
1535 fmt.Bmask = 0x00ff0000;
1536 fmt.Amask = 0x00000000;
1547 RETVAL = SDL_ConvertSurface(surface,&fmt,surface->flags);
1552 ConvertRGBA ( surface )
1553 SDL_Surface * surface
1555 SDL_PixelFormat fmt;
1557 fmt.BitsPerPixel = 32;
1558 fmt.BytesPerPixel = 4;
1559 fmt.Rmask = 0x000000ff;
1560 fmt.Gmask = 0x0000ff00;
1561 fmt.Bmask = 0x00ff0000;
1562 fmt.Amask = 0xff000000;
1573 RETVAL = SDL_ConvertSurface(surface,&fmt,surface->flags);
1578 BlitSurface ( src, src_rect, dest, dest_rect )
1584 RETVAL = SDL_BlitSurface(src,src_rect,dest,dest_rect);
1589 FillRect ( dest, dest_rect, color )
1594 Uint32 pixel = SDL_MapRGB(dest->format,color->r,color->g,color->b);
1595 RETVAL = SDL_FillRect(dest,dest_rect,pixel);
1602 RETVAL = SDL_GetAppState();
1608 WMSetCaption ( title, icon )
1612 SDL_WM_SetCaption(title,icon);
1618 SDL_WM_GetCaption(&title,&icon);
1620 av_push(RETVAL,newSVpv(title,0));
1621 av_push(RETVAL,newSVpv(icon,0));
1629 SDL_WM_SetIcon(icon,NULL);
1644 mask = SDL_GetMouseState(&x,&y);
1646 av_push(RETVAL,newSViv(mask));
1647 av_push(RETVAL,newSViv(x));
1648 av_push(RETVAL,newSViv(y));
1653 GetRelativeMouseState ()
1658 mask = SDL_GetRelativeMouseState(&x,&y);
1660 av_push(RETVAL,newSViv(mask));
1661 av_push(RETVAL,newSViv(x));
1662 av_push(RETVAL,newSViv(y));
1667 NewCursor ( data, mask, x ,y )
1673 RETVAL = SDL_CreateCursor((Uint8*)data->pixels,
1674 (Uint8*)mask->pixels,data->w,data->h,x,y);
1679 FreeCursor ( cursor )
1682 SDL_FreeCursor(cursor);
1685 SetCursor ( cursor )
1688 SDL_SetCursor(cursor);
1693 RETVAL = SDL_GetCursor();
1698 ShowCursor ( toggle )
1701 RETVAL = SDL_ShowCursor(toggle);
1706 NewAudioSpec ( freq, format, channels, samples )
1712 RETVAL = (SDL_AudioSpec *)safemalloc(sizeof(SDL_AudioSpec));
1713 RETVAL->freq = freq;
1714 RETVAL->format = format;
1715 RETVAL->channels = channels;
1716 RETVAL->samples = samples;
1721 FreeAudioSpec ( spec )
1727 NewAudioCVT ( src_format, src_channels, src_rate, dst_format, dst_channels, dst_rate)
1735 RETVAL = (SDL_AudioCVT *)safemalloc(sizeof(SDL_AudioCVT));
1736 if (SDL_BuildAudioCVT(RETVAL,src_format, src_channels, src_rate,
1737 dst_format, dst_channels, dst_rate)) {
1738 safefree(RETVAL); RETVAL = NULL; }
1743 FreeAudioCVT ( cvt )
1749 ConvertAudioData ( cvt, data, len )
1755 cvt->buf = (Uint8*) safemalloc(cvt->len*cvt->len_mult);
1756 memcpy(cvt->buf,data,cvt->len);
1757 RETVAL = SDL_ConvertAudio(cvt);
1762 OpenAudio ( spec, callback )
1766 spec->userdata = (void*)callback;
1767 spec->callback = sdl_perl_audio_callback;
1768 RETVAL = SDL_OpenAudio(spec,NULL);
1775 RETVAL = SDL_GetAudioStatus ();
1783 SDL_PauseAudio(p_on);
1807 LoadWAV ( filename, spec )
1811 SDL_AudioSpec *temp;
1816 temp = SDL_LoadWAV(filename,spec,&buf,&len);
1817 if ( ! temp ) goto error;
1818 av_push(RETVAL,newSViv(PTR2IV(temp)));
1819 av_push(RETVAL,newSViv(PTR2IV(buf)));
1820 av_push(RETVAL,newSViv(len));
1825 #ifdef HAVE_SDL_MIXER
1828 MixAudio ( dst, src, len, volume )
1834 SDL_MixAudio(dst,src,len,volume);
1837 MixOpenAudio ( frequency, format, channels, chunksize )
1843 RETVAL = Mix_OpenAudio(frequency, format, channels, chunksize);
1848 MixAllocateChannels ( number )
1851 RETVAL = Mix_AllocateChannels(number);
1858 int freq, channels, status;
1860 status = Mix_QuerySpec(&freq,&format,&channels);
1862 av_push(RETVAL,newSViv(status));
1863 av_push(RETVAL,newSViv(freq));
1864 av_push(RETVAL,newSViv(format));
1865 av_push(RETVAL,newSViv(channels));
1870 MixLoadWAV ( filename )
1873 RETVAL = Mix_LoadWAV(filename);
1878 MixLoadMusic ( filename )
1881 RETVAL = Mix_LoadMUS(filename);
1886 MixQuickLoadWAV ( buf )
1889 RETVAL = Mix_QuickLoad_WAV(buf);
1894 MixFreeChunk( chunk )
1897 Mix_FreeChunk(chunk);
1900 MixFreeMusic ( music )
1903 Mix_FreeMusic(music);
1906 MixSetPostMixCallback ( func, arg )
1910 Mix_SetPostMix(func,arg);
1915 RETVAL = sdl_perl_music_callback;
1920 MixSetMusicHook ( func, arg )
1924 Mix_HookMusic(func,arg);
1927 MixSetMusicFinishedHook ( func )
1930 mix_music_finished_cv = func;
1931 Mix_HookMusicFinished(sdl_perl_music_finished_callback);
1934 MixGetMusicHookData ()
1936 RETVAL = Mix_GetMusicHookData();
1941 MixReverseChannels ( number )
1944 RETVAL = Mix_ReserveChannels ( number );
1949 MixGroupChannel ( which, tag )
1953 RETVAL = Mix_GroupChannel(which,tag);
1958 MixGroupChannels ( from, to, tag )
1963 RETVAL = Mix_GroupChannels(from,to,tag);
1968 MixGroupAvailable ( tag )
1971 RETVAL = Mix_GroupAvailable(tag);
1976 MixGroupCount ( tag )
1979 RETVAL = Mix_GroupCount(tag);
1984 MixGroupOldest ( tag )
1987 RETVAL = Mix_GroupOldest(tag);
1992 MixGroupNewer ( tag )
1995 RETVAL = Mix_GroupNewer(tag);
2000 MixPlayChannel ( channel, chunk, loops )
2005 RETVAL = Mix_PlayChannel(channel,chunk,loops);
2010 MixPlayChannelTimed ( channel, chunk, loops, ticks )
2016 RETVAL = Mix_PlayChannelTimed(channel,chunk,loops,ticks);
2021 MixPlayMusic ( music, loops )
2025 RETVAL = Mix_PlayMusic(music,loops);
2030 MixFadeInChannel ( channel, chunk, loops, ms )
2036 RETVAL = Mix_FadeInChannel(channel,chunk,loops,ms);
2041 MixFadeInChannelTimed ( channel, chunk, loops, ms, ticks )
2048 RETVAL = Mix_FadeInChannelTimed(channel,chunk,loops,ms,ticks);
2053 MixFadeInMusic ( music, loops, ms )
2058 RETVAL = Mix_FadeInMusic(music,loops,ms);
2063 MixVolume ( channel, volume )
2067 RETVAL = Mix_Volume(channel,volume);
2072 MixVolumeChunk ( chunk, volume )
2076 RETVAL = Mix_VolumeChunk(chunk,volume);
2081 MixVolumeMusic ( volume )
2084 RETVAL = Mix_VolumeMusic(volume);
2089 MixHaltChannel ( channel )
2092 RETVAL = Mix_HaltChannel(channel);
2097 MixHaltGroup ( tag )
2100 RETVAL = Mix_HaltGroup(tag);
2107 RETVAL = Mix_HaltMusic();
2112 MixExpireChannel ( channel, ticks )
2116 RETVAL = Mix_ExpireChannel ( channel,ticks);
2121 MixFadeOutChannel ( which, ms )
2125 RETVAL = Mix_FadeOutChannel(which,ms);
2130 MixFadeOutGroup ( which, ms )
2134 RETVAL = Mix_FadeOutGroup(which,ms);
2139 MixFadeOutMusic ( ms )
2142 RETVAL = Mix_FadeOutMusic(ms);
2149 RETVAL = Mix_FadingMusic();
2154 MixFadingChannel( which )
2157 RETVAL = Mix_FadingChannel(which);
2162 MixPause ( channel )
2168 MixResume ( channel )
2171 Mix_Resume(channel);
2174 MixPaused ( channel )
2177 RETVAL = Mix_Paused(channel);
2199 RETVAL = Mix_PausedMusic();
2204 MixPlaying( channel )
2207 RETVAL = Mix_Playing(channel);
2214 RETVAL = Mix_PlayingMusic();
2227 GLLoadLibrary ( path )
2230 RETVAL = SDL_GL_LoadLibrary(path);
2235 GLGetProcAddress ( proc )
2238 RETVAL = SDL_GL_GetProcAddress(proc);
2243 GLSetAttribute ( attr, value )
2247 RETVAL = SDL_GL_SetAttribute(attr, value);
2252 GLGetAttribute ( attr )
2257 av_push(RETVAL,newSViv(SDL_GL_GetAttribute(attr, &value)));
2258 av_push(RETVAL,newSViv(value));
2265 SDL_GL_SwapBuffers ();
2271 RETVAL = (SDL_BYTEORDER == SDL_BIG_ENDIAN);
2278 RETVAL = SDL_NumJoysticks();
2283 JoystickName ( index )
2286 RETVAL = (char*)SDL_JoystickName(index);
2291 JoystickOpen ( index )
2294 RETVAL = SDL_JoystickOpen(index);
2299 JoystickOpened ( index )
2302 RETVAL = SDL_JoystickOpened(index);
2307 JoystickIndex ( joystick )
2308 SDL_Joystick *joystick
2310 RETVAL = SDL_JoystickIndex(joystick);
2315 JoystickNumAxes ( joystick )
2316 SDL_Joystick *joystick
2318 RETVAL = SDL_JoystickNumAxes(joystick);
2323 JoystickNumBalls ( joystick )
2324 SDL_Joystick *joystick
2326 RETVAL = SDL_JoystickNumBalls(joystick);
2331 JoystickNumHats ( joystick )
2332 SDL_Joystick *joystick
2334 RETVAL = SDL_JoystickNumHats(joystick);
2339 JoystickNumButtons ( joystick )
2340 SDL_Joystick *joystick
2342 RETVAL = SDL_JoystickNumButtons(joystick);
2349 SDL_JoystickUpdate();
2352 JoystickGetAxis ( joystick, axis )
2353 SDL_Joystick *joystick
2356 RETVAL = SDL_JoystickGetAxis(joystick,axis);
2361 JoystickGetHat ( joystick, hat )
2362 SDL_Joystick *joystick
2365 RETVAL = SDL_JoystickGetHat(joystick,hat);
2370 JoystickGetButton ( joystick, button)
2371 SDL_Joystick *joystick
2374 RETVAL = SDL_JoystickGetButton(joystick,button);
2379 JoystickGetBall ( joystick, ball )
2380 SDL_Joystick *joystick
2384 success = SDL_JoystickGetBall(joystick,ball,&dx,&dy);
2386 av_push(RETVAL,newSViv(success));
2387 av_push(RETVAL,newSViv(dx));
2388 av_push(RETVAL,newSViv(dy));
2393 JoystickClose ( joystick )
2394 SDL_Joystick *joystick
2396 SDL_JoystickClose(joystick);
2399 JoyAxisEventWhich ( e )
2402 RETVAL = e->jaxis.which;
2407 JoyAxisEventAxis ( e )
2410 RETVAL = e->jaxis.axis;
2415 JoyAxisEventValue ( e )
2418 RETVAL = e->jaxis.value;
2423 JoyButtonEventWhich ( e )
2426 RETVAL = e->jbutton.which;
2431 JoyButtonEventButton ( e )
2434 RETVAL = e->jbutton.button;
2439 JoyButtonEventState ( e )
2442 RETVAL = e->jbutton.state;
2447 JoyHatEventWhich ( e )
2450 RETVAL = e->jhat.which;
2455 JoyHatEventHat ( e )
2458 RETVAL = e->jhat.hat;
2463 JoyHatEventValue ( e )
2466 RETVAL = e->jhat.value;
2471 JoyBallEventWhich ( e )
2474 RETVAL = e->jball.which;
2479 JoyBallEventBall ( e )
2482 RETVAL = e->jball.ball;
2487 JoyBallEventXrel ( e )
2490 RETVAL = e->jball.xrel;
2495 JoyBallEventYrel ( e )
2498 RETVAL = e->jball.yrel;
2503 SetClipRect ( surface, rect )
2504 SDL_Surface *surface
2507 SDL_SetClipRect(surface,rect);
2510 GetClipRect ( surface )
2511 SDL_Surface *surface
2513 RETVAL = (SDL_Rect*) safemalloc(sizeof(SDL_Rect));
2514 SDL_GetClipRect(surface,RETVAL);
2524 RETVAL = SDLNet_Init();
2534 NetNewIPaddress ( host, port )
2538 RETVAL = (IPaddress*) safemalloc(sizeof(IPaddress));
2539 RETVAL->host = host;
2540 RETVAL->port = port;
2545 NetIPaddressHost ( ip )
2553 NetIPaddressPort ( ip )
2561 NetFreeIPaddress ( ip )
2567 NetResolveIP ( address )
2570 RETVAL = SDLNet_ResolveIP(address);
2575 NetResolveHost ( address, host, port )
2580 RETVAL = SDLNet_ResolveHost(address,host,port);
2588 RETVAL = SDLNet_TCP_Open(ip);
2593 NetTCPAccept ( server )
2596 RETVAL = SDLNet_TCP_Accept(server);
2601 NetTCPGetPeerAddress ( sock )
2604 RETVAL = SDLNet_TCP_GetPeerAddress(sock);
2609 NetTCPSend ( sock, data, len )
2614 RETVAL = SDLNet_TCP_Send(sock,data,len);
2619 NetTCPRecv ( sock, maxlen )
2625 buffer = safemalloc(maxlen);
2627 status = SDLNet_TCP_Recv(sock,buffer,maxlen);
2628 av_push(RETVAL,newSViv(status));
2629 av_push(RETVAL,newSVpvn((char*)buffer,maxlen));
2634 NetTCPClose ( sock )
2637 SDLNet_TCP_Close(sock);
2640 NetAllocPacket ( size )
2643 RETVAL = SDLNet_AllocPacket(size);
2648 NetAllocPacketV ( howmany, size )
2652 RETVAL = SDLNet_AllocPacketV(howmany,size);
2657 NetResizePacket ( packet, newsize )
2661 RETVAL = SDLNet_ResizePacket(packet,newsize);
2666 NetFreePacket ( packet )
2669 SDLNet_FreePacket(packet);
2672 NetFreePacketV ( packet )
2675 SDLNet_FreePacketV(packet);
2681 RETVAL = SDLNet_UDP_Open(port);
2686 NetUDPBind ( sock, channel, address )
2691 RETVAL = SDLNet_UDP_Bind(sock,channel,address);
2696 NetUDPUnbind ( sock, channel )
2700 SDLNet_UDP_Unbind(sock,channel);
2703 NetUDPGetPeerAddress ( sock, channel )
2707 RETVAL = SDLNet_UDP_GetPeerAddress(sock,channel);
2712 NetUDPSendV ( sock, packets, npackets )
2717 RETVAL = SDLNet_UDP_SendV(sock,packets,npackets);
2722 NetUDPSend ( sock, channel, packet )
2727 RETVAL = SDLNet_UDP_Send(sock,channel,packet);
2732 NetUDPRecvV ( sock, packets )
2736 RETVAL = SDLNet_UDP_RecvV(sock,packets);
2741 NetUDPRecv ( sock, packet )
2745 RETVAL = SDLNet_UDP_Recv(sock,packet);
2750 NetUDPClose ( sock )
2753 SDLNet_UDP_Close(sock);
2756 NetAllocSocketSet ( maxsockets )
2759 RETVAL = SDLNet_AllocSocketSet(maxsockets);
2764 NetTCP_AddSocket ( set, sock )
2765 SDLNet_SocketSet set
2768 RETVAL = SDLNet_TCP_AddSocket(set,sock);
2773 NetUDP_AddSocket ( set, sock )
2774 SDLNet_SocketSet set
2777 RETVAL = SDLNet_UDP_AddSocket(set,sock);
2782 NetTCP_DelSocket ( set, sock )
2783 SDLNet_SocketSet set
2786 RETVAL = SDLNet_TCP_DelSocket(set,sock);
2791 NetUDP_DelSocket ( set, sock )
2792 SDLNet_SocketSet set
2795 RETVAL = SDLNet_UDP_DelSocket(set,sock);
2800 NetCheckSockets ( set, timeout )
2801 SDLNet_SocketSet set
2804 RETVAL = SDLNet_CheckSockets(set,timeout);
2809 NetSocketReady ( sock )
2810 SDLNet_GenericSocket sock
2812 RETVAL = SDLNet_SocketReady(sock);
2817 NetFreeSocketSet ( set )
2818 SDLNet_SocketSet set
2820 SDLNet_FreeSocketSet(set);
2823 NetWrite16 ( value, area )
2827 SDLNet_Write16(value,area);
2830 NetWrite32 ( value, area )
2834 SDLNet_Write32(value,area);
2840 RETVAL = SDLNet_Read16(area);
2848 RETVAL = SDLNet_Read32(area);
2859 RETVAL = TTF_Init();
2869 TTFOpenFont ( file, ptsize )
2873 RETVAL = TTF_OpenFont(file,ptsize);
2878 TTFGetFontStyle ( font )
2881 RETVAL = TTF_GetFontStyle(font);
2886 TTFSetFontStyle ( font, style )
2890 TTF_SetFontStyle(font,style);
2893 TTFFontHeight ( font )
2896 RETVAL = TTF_FontHeight(font);
2901 TTFFontAscent ( font )
2904 RETVAL = TTF_FontAscent(font);
2909 TTFFontDescent ( font )
2912 RETVAL = TTF_FontDescent(font);
2917 TTFFontLineSkip ( font )
2920 RETVAL = TTF_FontLineSkip(font);
2925 TTFGlyphMetrics ( font, ch )
2929 int minx, miny, maxx, maxy, advance;
2931 TTF_GlyphMetrics(font, ch, &minx, &miny, &maxx, &maxy, &advance);
2932 av_push(RETVAL,newSViv(minx));
2933 av_push(RETVAL,newSViv(miny));
2934 av_push(RETVAL,newSViv(maxx));
2935 av_push(RETVAL,newSViv(maxy));
2936 av_push(RETVAL,newSViv(advance));
2941 TTFSizeText ( font, text )
2947 TTF_SizeText(font,text,&w,&h);
2948 av_push(RETVAL,newSViv(w));
2949 av_push(RETVAL,newSViv(h));
2954 TTFSizeUTF8 ( font, text )
2960 TTF_SizeUTF8(font,text,&w,&h);
2961 av_push(RETVAL,newSViv(w));
2962 av_push(RETVAL,newSViv(h));
2967 TTFSizeUNICODE ( font, text )
2973 TTF_SizeUNICODE(font,text,&w,&h);
2974 av_push(RETVAL,newSViv(w));
2975 av_push(RETVAL,newSViv(h));
2980 TTFRenderTextSolid ( font, text, fg )
2985 RETVAL = TTF_RenderText_Solid(font,text,*fg);
2990 TTFRenderUTF8Solid ( font, text, fg )
2995 RETVAL = TTF_RenderUTF8_Solid(font,text,*fg);
3000 TTFRenderUNICODESolid ( font, text, fg )
3005 RETVAL = TTF_RenderUNICODE_Solid(font,text,*fg);
3010 TTFRenderGlyphSolid ( font, ch, fg )
3015 RETVAL = TTF_RenderGlyph_Solid(font,ch,*fg);
3020 TTFRenderTextShaded ( font, text, fg, bg )
3026 RETVAL = TTF_RenderText_Shaded(font,text,*fg,*bg);
3031 TTFRenderUTF8Shaded( font, text, fg, bg )
3037 RETVAL = TTF_RenderUTF8_Shaded(font,text,*fg,*bg);
3042 TTFRenderUNICODEShaded( font, text, fg, bg )
3048 RETVAL = TTF_RenderUNICODE_Shaded(font,text,*fg,*bg);
3053 TTFRenderGlyphShaded ( font, ch, fg, bg )
3059 RETVAL = TTF_RenderGlyph_Shaded(font,ch,*fg,*bg);
3064 TTFRenderTextBlended( font, text, fg )
3069 RETVAL = TTF_RenderText_Blended(font,text,*fg);
3074 TTFRenderUTF8Blended( font, text, fg )
3079 RETVAL = TTF_RenderUTF8_Blended(font,text,*fg);
3084 TTFRenderUNICODEBlended( font, text, fg )
3089 RETVAL = TTF_RenderUNICODE_Blended(font,text,*fg);
3094 TTFRenderGlyphBlended( font, ch, fg )
3099 RETVAL = TTF_RenderGlyph_Blended(font,ch,*fg);
3104 TTFCloseFont ( font )
3107 TTF_CloseFont(font);
3110 TTFPutString ( font, mode, surface, x, y, fg, bg, text )
3113 SDL_Surface *surface
3128 img = TTF_RenderText_Solid(font,text,*fg);
3129 TTF_SizeText(font,text,&w,&h);
3134 img = TTF_RenderText_Shaded(font,text,*fg,*bg);
3135 TTF_SizeText(font,text,&w,&h);
3140 img = TTF_RenderText_Blended(font,text,*fg);
3141 TTF_SizeText(font,text,&w,&h);
3146 img = TTF_RenderUTF8_Solid(font,text,*fg);
3147 TTF_SizeUTF8(font,text,&w,&h);
3152 img = TTF_RenderUTF8_Shaded(font,text,*fg,*bg);
3153 TTF_SizeUTF8(font,text,&w,&h);
3158 img = TTF_RenderUTF8_Blended(font,text,*fg);
3159 TTF_SizeUTF8(font,text,&w,&h);
3164 img = TTF_RenderUNICODE_Solid(font,(Uint16*)text,*fg);
3165 TTF_SizeUNICODE(font,(Uint16*)text,&w,&h);
3169 case UNICODE_SHADED:
3170 img = TTF_RenderUNICODE_Shaded(font,(Uint16*)text,*fg,*bg);
3171 TTF_SizeUNICODE(font,(Uint16*)text,&w,&h);
3175 case UNICODE_BLENDED:
3176 img = TTF_RenderUNICODE_Blended(font,(Uint16*)text,*fg);
3177 TTF_SizeUNICODE(font,(Uint16*)text,&w,&h);
3182 img = TTF_RenderText_Shaded(font,text,*fg,*bg);
3183 TTF_SizeText(font,text,&w,&h);
3187 if ( img && img->format && img->format->palette ) {
3188 SDL_Color *c = &img->format->palette->colors[0];
3189 Uint32 key = SDL_MapRGB( img->format, c->r, c->g, c->b );
3190 SDL_SetColorKey(img,SDL_SRCCOLORKEY,key );
3191 if (0 > SDL_BlitSurface(img,NULL,surface,&dest)) {
3192 SDL_FreeSurface(img);
3204 CreateYUVOverlay ( width, height, format, display )
3208 SDL_Surface *display
3210 RETVAL = SDL_CreateYUVOverlay ( width, height, format, display );
3215 LockYUVOverlay ( overlay )
3216 SDL_Overlay *overlay
3218 RETVAL = SDL_LockYUVOverlay(overlay);
3223 UnlockYUVOverlay ( overlay )
3224 SDL_Overlay *overlay
3226 SDL_UnlockYUVOverlay(overlay);
3229 DisplayYUVOverlay ( overlay, dstrect )
3230 SDL_Overlay *overlay
3233 RETVAL = SDL_DisplayYUVOverlay ( overlay, dstrect );
3238 FreeYUVOverlay ( overlay )
3239 SDL_Overlay *overlay
3241 SDL_FreeYUVOverlay ( overlay );
3244 OverlayFormat ( overlay, ... )
3245 SDL_Overlay *overlay
3248 overlay->format = SvIV(ST(1));
3249 RETVAL = overlay->format;
3254 OverlayW ( overlay, ... )
3255 SDL_Overlay *overlay
3258 overlay->w = SvIV(ST(1));
3259 RETVAL = overlay->w;
3264 OverlayH ( overlay, ... )
3265 SDL_Overlay *overlay
3268 overlay->h = SvIV(ST(1));
3269 RETVAL = overlay->h;
3274 OverlayPlanes ( overlay, ... )
3275 SDL_Overlay *overlay
3278 overlay->planes = SvIV(ST(1));
3279 RETVAL = overlay->planes;
3284 OverlayHW ( overlay )
3285 SDL_Overlay *overlay
3287 RETVAL = overlay->hw_overlay;
3292 OverlayPitches ( overlay )
3293 SDL_Overlay *overlay
3295 RETVAL = overlay->pitches;
3300 OverlayPixels ( overlay )
3301 SDL_Overlay *overlay
3303 RETVAL = overlay->pixels;
3308 WMToggleFullScreen ( surface )
3309 SDL_Surface *surface
3311 RETVAL = SDL_WM_ToggleFullScreen(surface);
3316 WMGrabInput ( mode )
3319 RETVAL = SDL_WM_GrabInput(mode);
3326 RETVAL = SDL_WM_IconifyWindow();
3334 RETVAL = e->resize.w;
3342 RETVAL = e->resize.h;
3350 RETVAL = SDL_AudioDriverName(name,32);
3358 if (k >= SDLK_LAST) Perl_croak (aTHX_ "Key out of range");
3359 RETVAL = SDL_GetKeyState(NULL)[k];
3368 RETVAL = (SMPEG_Info *) safemalloc (sizeof(SMPEG_Info));
3373 FreeSMPEGInfo ( info )
3379 SMPEGInfoHasAudio ( info )
3382 RETVAL = info->has_audio;
3387 SMPEGInfoHasVideo ( info )
3390 RETVAL = info->has_video;
3395 SMPEGInfoWidth ( info )
3398 RETVAL = info->width;
3403 SMPEGInfoHeight ( info )
3406 RETVAL = info->height;
3411 SMPEGInfoCurrentFrame ( info )
3414 RETVAL = info->current_frame;
3419 SMPEGInfoCurrentFPS ( info )
3422 RETVAL = info->current_fps;
3427 SMPEGInfoCurrentAudioFrame ( info )
3430 RETVAL = info->audio_current_frame;
3435 SMPEGInfoCurrentOffset ( info )
3438 RETVAL = info->current_offset;
3443 SMPEGInfoTotalSize ( info )
3446 RETVAL = info->total_size;
3451 SMPEGInfoCurrentTime ( info )
3454 RETVAL = info->current_time;
3459 SMPEGInfoTotalTime ( info )
3462 RETVAL = info->total_time;
3470 RETVAL = SMPEG_error(mpeg);
3475 NewSMPEG ( filename, info, use_audio )
3480 #ifdef HAVE_SDL_MIXER
3481 RETVAL = SMPEG_new(filename,info,0);
3483 RETVAL = SMPEG_new(filename,info,use_audio);
3495 SMPEGEnableAudio ( mpeg , flag )
3499 SMPEG_enableaudio(mpeg,flag);
3500 #ifdef HAVE_SDL_MIXER
3501 sdl_perl_use_smpeg_audio = flag;
3505 SMPEGEnableVideo ( mpeg , flag )
3509 SMPEG_enablevideo(mpeg,flag);
3512 SMPEGSetVolume ( mpeg , volume )
3516 SMPEG_setvolume(mpeg,volume);
3519 SMPEGSetDisplay ( mpeg, dest, surfLock )
3524 SMPEG_setdisplay(mpeg,dest,surfLock,NULL);
3527 SMPEGScaleXY ( mpeg, w, h)
3532 SMPEG_scaleXY(mpeg,w,h);
3535 SMPEGScale ( mpeg, scale )
3539 SMPEG_scale(mpeg,scale);
3545 SDL_AudioSpec audiofmt;
3548 #ifdef HAVE_SDL_MIXER
3549 if (sdl_perl_use_smpeg_audio ) {
3550 SMPEG_enableaudio(mpeg, 0);
3551 Mix_QuerySpec(&freq, &format, &channels);
3552 audiofmt.format = format;
3553 audiofmt.freq = freq;
3554 audiofmt.channels = channels;
3555 SMPEG_actualSpec(mpeg, &audiofmt);
3556 Mix_HookMusic(SMPEG_playAudioSDL, mpeg);
3557 SMPEG_enableaudio(mpeg, 1);
3563 SMPEGStatus ( mpeg )
3566 RETVAL = SMPEG_status(mpeg);
3577 SMPEGLoop ( mpeg, repeat )
3581 SMPEG_loop(mpeg,repeat);
3588 #ifdef HAVE_SDL_MIXER
3589 Mix_HookMusic(NULL, NULL);
3593 SMPEGRewind ( mpeg )
3599 SMPEGSeek ( mpeg, bytes )
3603 SMPEG_seek(mpeg,bytes);
3606 SMPEGSkip ( mpeg, seconds )
3610 SMPEG_skip(mpeg,seconds);
3613 SMPEGSetDisplayRegion ( mpeg, rect )
3617 SMPEG_setdisplayregion(mpeg,rect->x,rect->y,rect->w,rect->h);
3620 SMPEGRenderFrame ( mpeg, frame )
3624 SMPEG_renderFrame(mpeg,frame);
3627 SMPEGGetInfo ( mpeg )
3630 RETVAL = (SMPEG_Info *) safemalloc (sizeof(SMPEG_Info));
3631 SMPEG_getinfo(mpeg,RETVAL);
3641 GFXRotoZoom ( src, angle, zoom, smooth)
3647 RETVAL = rotozoomSurface( src, angle, zoom, smooth);
3652 GFXZoom ( src, zoomx, zoomy, smooth)
3658 RETVAL = zoomSurface( src, zoomx, zoomy, smooth);
3663 GFXPixelColor ( dst, x, y, color )
3669 RETVAL = pixelColor( dst, x, y, color);
3674 GFXPixelRGBA ( dst, x, y, r, g, b, a )
3683 RETVAL = pixelRGBA( dst, x, y, r, g, b, a );
3688 GFXHlineColor ( dst, x1, x2, y, color )
3695 RETVAL = hlineColor( dst, x1, x2, y, color );
3700 GFXHlineRGBA ( dst, x1, x2, y, r, g, b, a )
3710 RETVAL = hlineRGBA( dst, x1, x2, y, r, g, b, a );
3715 GFXVlineColor ( dst, x, y1, y2, color )
3722 RETVAL = vlineColor( dst, x, y1, y2, color );
3727 GFXVlineRGBA ( dst, x, y1, y2, r, g, b, a )
3737 RETVAL = vlineRGBA( dst, x, y1, y2, r, g, b, a );
3742 GFXRectangleColor ( dst, x1, y1, x2, y2, color )
3750 RETVAL = rectangleColor( dst, x1, y1, x2, y2, color );
3755 GFXRectangleRGBA ( dst, x1, y1, x2, y2, r, g, b, a )
3766 RETVAL = rectangleRGBA( dst, x1, y1, x2, y2, r, g, b, a );
3771 GFXBoxColor ( dst, x1, y1, x2, y2, color )
3779 RETVAL = boxColor( dst, x1, y1, x2, y2, color );
3784 GFXBoxRGBA ( dst, x1, y1, x2, y2, r, g, b, a )
3795 RETVAL = boxRGBA( dst, x1, y1, x2, y2, r, g, b, a );
3800 GFXLineColor ( dst, x1, y1, x2, y2, color )
3808 RETVAL = lineColor( dst, x1, y1, x2, y2, color );
3813 GFXLineRGBA ( dst, x1, y1, x2, y2, r, g, b, a )
3824 RETVAL = lineRGBA( dst, x1, y1, x2, y2, r, g, b, a );
3829 GFXAalineColor ( dst, x1, y1, x2, y2, color )
3837 RETVAL = aalineColor( dst, x1, y1, x2, y2, color );
3842 GFXAalineRGBA ( dst, x1, y1, x2, y2, r, g, b, a )
3853 RETVAL = aalineRGBA( dst, x1, y1, x2, y2, r, g, b, a );
3858 GFXCircleColor ( dst, x, y, r, color )
3865 RETVAL = circleColor( dst, x, y, r, color );
3870 GFXCircleRGBA ( dst, x, y, rad, r, g, b, a )
3880 RETVAL = circleRGBA( dst, x, y, rad, r, g, b, a );
3885 GFXAacircleColor ( dst, x, y, r, color )
3892 RETVAL = aacircleColor( dst, x, y, r, color );
3897 GFXAacircleRGBA ( dst, x, y, rad, r, g, b, a )
3907 RETVAL = aacircleRGBA( dst, x, y, rad, r, g, b, a );
3912 GFXFilledCircleColor ( dst, x, y, r, color )
3919 RETVAL = filledCircleColor( dst, x, y, r, color );
3924 GFXFilledCircleRGBA ( dst, x, y, rad, r, g, b, a )
3934 RETVAL = filledCircleRGBA( dst, x, y, rad, r, g, b, a );
3939 GFXEllipseColor ( dst, x, y, rx, ry, color )
3947 RETVAL = ellipseColor( dst, x, y, rx, ry, color );
3952 GFXEllipseRGBA ( dst, x, y, rx, ry, r, g, b, a )
3963 RETVAL = ellipseRGBA( dst, x, y, rx, ry, r, g, b, a );
3968 GFXAaellipseColor ( dst, xc, yc, rx, ry, color )
3976 RETVAL = aaellipseColor( dst, xc, yc, rx, ry, color );
3981 GFXAaellipseRGBA ( dst, x, y, rx, ry, r, g, b, a )
3992 RETVAL = aaellipseRGBA( dst, x, y, rx, ry, r, g, b, a );
3997 GFXFilledEllipseColor ( dst, x, y, rx, ry, color )
4005 RETVAL = filledEllipseColor( dst, x, y, rx, ry, color );
4010 GFXFilledEllipseRGBA ( dst, x, y, rx, ry, r, g, b, a )
4021 RETVAL = filledEllipseRGBA( dst, x, y, rx, ry, r, g, b, a );
4026 GFXFilledPieColor ( dst, x, y, rad, start, end, color )
4035 RETVAL = filledPieColor( dst, x, y, rad, start, end, color );
4040 GFXFilledPieRGBA ( dst, x, y, rad, start, end, r, g, b, a )
4052 RETVAL = filledPieRGBA( dst, x, y, rad, start, end, r, g, b, a );
4057 GFXPolygonColor ( dst, vx, vy, n, color )
4064 RETVAL = polygonColor( dst, vx, vy, n, color );
4069 GFXPolygonRGBA ( dst, vx, vy, n, r, g, b, a )
4079 RETVAL = polygonRGBA( dst, vx, vy, n, r, g, b, a );
4084 GFXAapolygonColor ( dst, vx, vy, n, color )
4091 RETVAL = aapolygonColor( dst, vx, vy, n, color );
4096 GFXAapolygonRGBA ( dst, vx, vy, n, r, g, b, a )
4106 RETVAL = aapolygonRGBA( dst, vx, vy, n, r, g, b, a );
4111 GFXFilledPolygonColor ( dst, vx, vy, n, color )
4118 RETVAL = filledPolygonColor( dst, vx, vy, n, color );
4123 GFXFilledPolygonRGBA ( dst, vx, vy, n, r, g, b, a )
4133 RETVAL = filledPolygonRGBA( dst, vx, vy, n, r, g, b, a );
4138 GFXCharacterColor ( dst, x, y, c, color )
4145 RETVAL = characterColor( dst, x, y, c, color );
4150 GFXCharacterRGBA ( dst, x, y, c, r, g, b, a )
4160 RETVAL = characterRGBA( dst, x, y, c, r, g, b, a );
4165 GFXStringColor ( dst, x, y, c, color )
4172 RETVAL = stringColor( dst, x, y, c, color );
4177 GFXStringRGBA ( dst, x, y, c, r, g, b, a )
4187 RETVAL = stringRGBA( dst, x, y, c, r, g, b, a );
4197 SVG_Load ( filename )
4200 RETVAL = SVG_Load(filename);
4205 SVG_LoadBuffer ( data, len )
4209 RETVAL = SVG_LoadBuffer(data,len);
4214 SVG_SetOffset ( source, xoff, yoff )
4215 SDL_svg_context* source
4219 RETVAL = SVG_SetOffset(source,xoff,yoff);
4224 SVG_SetScale ( source, xscale, yscale )
4225 SDL_svg_context* source
4229 RETVAL = SVG_SetScale(source,xscale,yscale);
4234 SVG_RenderToSurface ( source, x, y, dest )
4235 SDL_svg_context* source
4240 RETVAL = SVG_RenderToSurface(source,x,y,dest);
4246 SDL_svg_context* source
4251 SVG_Set_Flags ( source, flags )
4252 SDL_svg_context* source
4255 SVG_Set_Flags(source,flags);
4258 SVG_Width ( source )
4259 SDL_svg_context* source
4261 RETVAL = SVG_Width(source);
4266 SVG_HEIGHT ( source )
4267 SDL_svg_context* source
4269 RETVAL = SVG_Height(source);
4274 SVG_SetClipping ( source, minx, miny, maxx, maxy )
4275 SDL_svg_context* source
4281 SVG_SetClipping(source,minx,miny,maxx,maxy);
4286 RETVAL = SVG_Version();
4293 #ifdef HAVE_SDL_SOUND
4296 SoundAudioInfoFormat ( audioinfo )
4297 Sound_AudioInfo* audioinfo
4299 RETVAL = audioinfo->format;
4304 SoundAudioInfoChannels ( audioinfo )
4305 Sound_AudioInfo* audioinfo
4307 RETVAL = audioinfo->channels;
4312 SoundAudioInforate ( audioinfo )
4313 Sound_AudioInfo* audioinfo
4315 RETVAL = audioinfo->rate;
4320 SoundDecoderInfoExtensions ( decoderinfo )
4321 Sound_DecoderInfo* decoderinfo
4324 for ( ext = decoderinfo->extensions; *ext != NULL; ext++ ){
4325 av_push(RETVAL,newSVpv(*ext,0));
4331 SoundDecoderInfoDescription ( decoderinfo )
4332 Sound_DecoderInfo* decoderinfo
4334 RETVAL = decoderinfo->description;
4339 SoundDecoderInfoAuthor ( decoderinfo )
4340 Sound_DecoderInfo* decoderinfo
4342 RETVAL = decoderinfo->author;
4347 SoundDecoderInfoUrl ( decoderinfo )
4348 Sound_DecoderInfo* decoderinfo
4350 RETVAL = decoderinfo->url;
4354 const Sound_DecoderInfo*
4355 SoundSampleDecoder ( sample )
4356 Sound_Sample* sample
4358 RETVAL = sample->decoder;
4363 SoundSampleDesired ( sample )
4364 Sound_Sample* sample
4366 RETVAL = &sample->desired;
4371 SoundSampleAcutal ( sample )
4372 Sound_Sample* sample
4374 RETVAL = &sample->actual;
4379 SoundSampleBuffer ( sample )
4380 Sound_Sample* sample
4382 RETVAL = sample->buffer;
4387 SoundSampleBufferSize ( sample )
4388 Sound_Sample* sample
4390 RETVAL = sample->buffer_size;
4395 SoundSampleFlags ( sample )
4396 Sound_Sample* sample
4398 RETVAL = (Uint32)sample->flags;
4405 RETVAL = Sound_Init();
4412 RETVAL = Sound_Quit();
4417 Sound_AvailableDecoders ( )
4420 const Sound_DecoderInfo** sdi;
4421 sdi = Sound_AvailableDecoders();
4423 for (;*sdi != NULL; ++sdi) {
4424 av_push(RETVAL,sv_2mortal(newSViv(PTR2IV(*sdi))));
4433 RETVAL = Sound_GetError();
4438 Sound_ClearError ( )
4443 Sound_NewSample ( rw, ext, desired, buffsize )
4446 Sound_AudioInfo* desired
4449 RETVAL = Sound_NewSample(rw,ext,desired,buffsize);
4454 Sound_NewSampleFromMem ( data, size, ext, desired, buffsize )
4458 Sound_AudioInfo* desired
4461 RETVAL = Sound_NewSampleFromMem(data,size,ext,desired,buffsize);
4466 Sound_NewSampleFromFile ( fname, desired, buffsize )
4468 Sound_AudioInfo* desired
4471 RETVAL = Sound_NewSampleFromFile(fname,desired,buffsize);
4476 Sound_FreeSample ( sample )
4477 Sound_Sample* sample
4479 Sound_FreeSample(sample);
4482 Sound_GetDuration ( sample )
4483 Sound_Sample* sample
4485 RETVAL = Sound_GetDuration(sample);
4490 Sound_SetBufferSize ( sample, size )
4491 Sound_Sample* sample
4494 RETVAL = Sound_SetBufferSize(sample,size);
4499 Sound_Decode ( sample )
4500 Sound_Sample* sample
4502 RETVAL = Sound_Decode(sample);
4507 Sound_DecodeAll ( sample )
4508 Sound_Sample* sample
4510 RETVAL = Sound_DecodeAll(sample);
4515 Sound_Rewind ( sample )
4516 Sound_Sample* sample
4518 RETVAL = Sound_Rewind(sample);
4523 Sound_Seek ( sample, ms )
4524 Sound_Sample* sample
4527 RETVAL = Sound_Seek(sample,ms);
4533 MODULE = SDL PACKAGE = SDL
4534 PROTOTYPES : DISABLE