Re: Function does not work SDL_thread () in conjunction with machine code?
- Posted by jimcbrown (admin) Nov 08, 2010
- 2318 views
javier07b9 said...
constant dato=allocate(8) atom key, t, arg
arg=allocate(8)
dummy = SDL_Init(SDL_INIT_TIMER)
key=SDL_GetKeyState(NULL)
function Thread(atom dato) while peek(dato)=0 do SDL_PumpEvents() end while return 0 end function
t = call_back({'+',routine_id("Thread")})
constant main_bucle=get_asm( "pushad "& "l1: "& "mov al,[key+27] "& "or al,al "& "jz l1 "& "mov [dato],al "& "popad "& "ret") resolve_param("dato",dato) resolve_param("key",key)
poke(dato,0)
dummy=SDL_CreateThread(t,arg) call(main_bucle)
SDL_Quit()
Euphoria is not compatible with SDL_CreateThread().