Wrapper Help
- Posted by Icy_Viking May 19, 2017
- 1330 views
I am working on my Irrlicht wrapper. So far, it is coming along well. However I am having an issue when trying to call string related functions.
In C you would do this.
C Code
irrIrrlichtDeviceSetWindowsCaption(L"01.HelloWorld");
Eu Wrapper Code
public constant xirrIrrlichtDeviceSetWindowCaption = define_c_proc(irr,"irrIrrlichtDeviceSetWindowCaption",{C_POINTER}) public procedure irrIrrlichtDeviceSetWindowCaption(atom strw) atom str = allocate_string(strw,1) c_proc(xirrIrrlichtDeviceSetWindowCaption,{str}) end procedure
Test
include std/machine.e include EuIrr.ew constant TRUE = 1, FALSE = 0 atom dims = irrDimension2duNew(800,600) atom campos = irrVector3dfNew(0,30,-40) atom camat = irrVector3dfNew(0,5,0) atom driver,scene,gui atom col = irrSColorNew(100,0,100,0) irrCreateDevice(dims,FALSE,TRUE,FALSE) driver = irrIrrlichtDeviceGetVideoDriver() scene = irrIrrlichtDeviceGetSceneManager() gui = irrIrrlichtDeviceGetGUIEnviroment() irrIrrlichtDeviceSetWindowsCaption("Hello World")
The error that comes up is type_check failure, strw is {72,101,108,108,111,32,87,111,114,108,100} Perhaps I need to make a machine call of some sort? Any help is appericated.