SoLoud Wrapper

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

Hello All,

I am currently working on a wrapper of SoLoud for Euphoria. It is an audio library. I just want to make sure I am wrapping the functions correctly. It has a C-API.

Its the way pointers are init that is throwing me off, just wanna make sure I won't need to do anything special when making a wrapper for Eu.

EDIT: I found another header file, maybe it won't be so hard, but just wanna make sure. Note that it does come with a DLL.

C Code from header 
Soloud * Soloud_create(); 
int Soloud_init(Soloud * aSoloud); 

C Code from the glue cpp file 
void * Soloud_create() 
{ 
  return (void *)new Soloud; 
} 
 
int Soloud_init(void * aClassPtr) 
{ 
	Soloud * cl = (Soloud *)aClassPtr; 
	return cl->init(); 
} 

atom sol 
 
ifdef WIN32 then 
	sol = open_dll("soloud_x86.dll") 
	elsifdef LINUX or FREEBSD then 
	sol = open_dll("soloud_x86.so") 
end ifdef 
 
public constant xSoloud_create = define_c_func(sol,"+Soloud_create",{},C_POINTER) 
 
public function Soloud_create() 
 
 return c_func(xSoloud_create,{}) 
	 
end function 
 
public constant xSoloud_init = define_c_func(sol,"+Soloud_init",{C_POINTER},C_INT) 
 
public function Soloud_init(atom ptr) 
 
 return c_func(xSoloud_init,{ptr}) 
	 
end function 
new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu