Parrot and Perl 6 Parrot and Perl 6 - Environments for Dynamic Languages #21

NCI Example

##  load the libSDL.so library
.local pmc libsdl
loadlib libsdl, 'libSDL'

## build an interface to SDL_Init and call it
## int SDL_Init(int)
.local pmc sdl_init, sdl_setvideomode
dlfunc sdl_function, libsdl, 'SDL_Init', 'ii'
dlfunc sdl_setvideomode, libsdl, 'SDL_SetVideoMode', 'piiil'

$I0 = sdl_function(0)
$P0 = sdl_setvideomode(640, 480, 24, 0)
Copyright © 2007 Patrick Michaud