bwr / flashsdl

This URL has Read+Write access

flashsdl / flashSDL.c
100644 33 lines (21 sloc) 0.551 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include "AS3.h"
#include <stdio.h>
#include "SDL.h"
 
extern AS3_Val FLASH_DISPLAY_PARENT_SPRITE;
 
AS3_Val run(void *data, AS3_Val args)
{
AS3_Val parent;
SDL_Surface *screen;
 
AS3_ArrayValue(args, "AS3ValType", &parent);
 
FLASH_DISPLAY_PARENT_SPRITE = parent;
 
SDL_Init(SDL_INIT_VIDEO);
 
screen = SDL_SetVideoMode(320, 240, 8, SDL_ANYFORMAT);
 
return parent;
}
 
int main(int argc, char **argv)
{
AS3_Val runFunction = AS3_Function(NULL, run);
 
AS3_Val libSDL = AS3_Object("run:AS3ValType", runFunction);
 
AS3_LibInit(libSDL);
 
return 0;
}