static void GLUT_Init( DaoProcess *proc, DaoValue *p[], int N ) { char *title = DaoValue_TryGetChars( p[2] ); window_width = DaoValue_TryGetInteger( p[0] ); window_height = DaoValue_TryGetInteger( p[1] ); daox_graphics_device_width = window_width; daox_graphics_device_height = window_height; fps_limit = DaoValue_TryGetInteger( p[3] ); test_fps = DaoValue_TryGetInteger( p[4] ); DaoxCanvas_glutInit( window_width, window_height, title ); }
static void DaoSTD_Eval( DaoProcess *proc, DaoValue *p[], int N ) { DaoVmSpace *vms = proc->vmSpace; DaoNamespace *ns = proc->activeNamespace; DaoStream *prevStream = proc->stdioStream; DaoStream *redirect = (DaoStream*) p[1]; char *source = DaoValue_TryGetChars( p[0] ); if( redirect != prevStream ) GC_Assign( & proc->stdioStream, redirect ); DaoProcess_Eval( proc, ns, source ); DaoProcess_PutValue( proc, proc->stackValues[0] ); if( redirect != prevStream ) GC_Assign( & proc->stdioStream, prevStream ); }
static void DaoSTD_Compile( DaoProcess *proc, DaoValue *p[], int N ) { char *source = DaoValue_TryGetChars( p[0] ); DaoNamespace *ns, *import = DaoValue_CastNamespace( p[1] ); DaoTuple *tuple = DaoProcess_PutTuple( proc, 0 ); ns = DaoNamespace_New( proc->vmSpace, "std::compile" ); if( import != NULL ) DaoNamespace_AddParent( ns, import ); DaoTuple_SetItem( tuple, (DaoValue*) ns, 0 ); if( DaoProcess_Compile( proc, ns, source ) ==0 ){ DaoTuple_SetItem( tuple, dao_none_value, 1 ); return; } DaoTuple_SetItem( tuple, ns->mainRoutines->items.pValue[ ns->mainRoutines->size-1 ], 1 ); }
static void FONT_Open( DaoProcess *proc, DaoValue *p[], int N ) { DaoxFont *self = (DaoxFont*) p[0]; DaoProcess_PutInteger( proc, DaoxFont_Open( self, DaoValue_TryGetChars( p[1] ) ) ); }
static void FONT_New( DaoProcess *proc, DaoValue *p[], int N ) { DaoxFont *self = DaoxFont_New(); DaoProcess_PutValue( proc, (DaoValue*) self ); if( N ) DaoxFont_Open( self, DaoValue_TryGetChars( p[0] ) ); }