SFML Wrapper

new topic     » topic index » view thread      » older message » newer message

Hello,

Am I going about this the right way?

 
include std/dll.e 
include std/machine.e 
include std/wildcard.e 
 
atom System, 
	 Audio, 
	 Graphics, 
	 Window, 
	 Network 
	  
System = open_dll("sfml-system.dll") 
Audio = open_dll("sfml-audio.dll") 
Graphics = open_dll("sfml-graphics.dll") 
Window = open_dll("sfml-window.dll") 
Network = open_dll("sfml-network.dll") 
 
if System = -1 then 
	puts(1,"Failed to open sfml-system!") 
	abort(1) 
end if 
 
if Audio = -1 then 
	puts(1,"Failed to open sfml-audio!") 
	abort(1) 
end if 
 
if Graphics = -1 then 
	puts(1,"Failed to open sfml-graphics!") 
	abort(1) 
end if 
 
if Window = -1 then 
	puts(1,"Failed to open sfml-window!") 
	abort(1) 
end if 
 
if Network = -1 then 
	puts(1,"Failed to open sfml-network!") 
	abort(1) 
end if 
 
constant xClock = define_c_func(System,"sf::Clock",{C_FLOAT,C_POINTER},C_POINTER), 
xClock_GetElapsedTime = define_c_func(System,"sf::Clock.GetElapsedTime",{C_FLOAT},C_FLOAT), 
xClock_Reset = define_c_func(System,"sf::Clock.Reset",{C_POINTER},C_POINTER) 
 
function GetElapsedTime() 
 
	return c_func(xClock_GetElapsedTime,{}) 
	 
end function 

As you can tell, I am attempting to write an SFML wrapper for euphoria. Wanna make sure I am heading in the right direction.

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu