I need to call a command from a DLL by Win32Api.
LoadTexture = Win32API.new('System/SFML.dll', 'sfml_load_texture', 'p', 'p')
I made two attempts:
LoadTexture.call("folder/file.png")
This second attempt only worked on wchar_t
:
buf = ''
for i in 0..filename.size - 1
buf += filename[i] + 0.chr end
buf += 0.chr * 260
LoadTexture.call(buf)
ThemessageIgetisalwayssomethinglikethis:
Failedtoloadimage"=" '¶È; ð¿w c H ". Reason: Unable to open