forum-msg-id-133921-edit

Original date:2019-06-01 20:15:53 Edited by: Icy_Viking Subject: Bad Routine Number

Hello,

So I recently went to check my SDL wrapper while using the new Euphoria 4.1.0 Beta 2 and noticed that I get a bad routine number -1 when trying to run a example program. This did not happen using 4.0.5.

--Wrapper Code 
atom sdl2 
 
ifdef WIN32 then 
  sdl2 = open_dll("SDL2.dll") 
 elsifdef LINUX or FREEBSD then 
  sdl2 = open_dll("SDL2.so") 
end ifdef 
 
if sdl2 = -1 then 
	puts(1,"Failed to load SDL2.dll!\n") 
	abort(0) 
end if 
 
public constant xSDL_Init = define_c_func(sdl2,"SDL_Init",{C_UINT},C_INT) 
 
public function SDL_Init(atom flags) 
 
 return c_func(xSDL_Init,{flags}) 
	 
end function 
--Sample Program 
 
include std/machine.e 
include EuSDL2.ew 
include flags.e 
 
atom width = 640, height = 480 
 
--Init SDL2 
if SDL_Init(SDL_INIT_EVERYTHING) = -1 then --Error appears to be coming from here (This worked fine in 4.0.5) 
	puts(1,"Could not init SDL2!\n") 
	abort(0) 
end if 
Not Categorized, Please Help

Search



Quick Links

User menu

Not signed in.

Misc Menu