Going About This Right

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

Hello,

I am wondering if I am going about this right, wrapping the SFML 2 library correctly.

 
public constant xsfTexture_createFromFile = define_c_func(gfx,"sfTexture_createFromFile",{C_POINTER,C_POINTER},C_POINTER) 
public function sfTexture_createFromFile(sequence file,atom area) 
 
 atom str,handle,ret,dat 
  
 str = allocate_string(file) 
  
 ret = c_func(xsfTexture_createFromFile,{handle = open(str,"rb"), area}) 
  
 if handle = -1 then 
 	puts(1,"Could not load file!\n") 
 	abort(0) 
 	else 
 		handle = gets(dat) 
 end if 
  
 close(handle) 
  
 return ret 
	 
end function 
 

I just want to make sure I am doing this correctly when loading a file in Eu. Also, keep in mind this is just a snippet of code I'm working on, I have many other functions already written. I can post more if needed.

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

Search



Quick Links

User menu

Not signed in.

Misc Menu