0

I trying to call a Win32Api dll function in Ruby:

LoadTexture = Win32API.new('System/SFML.dll', 'sfml_load_texture', 'p', 'p')

My code calling:

LoadTexture.call("folder/file.png")

My second try to convert data (just work with wchar_t)

  buf = ''

  for i in 0..filename.size - 1
    buf += filename[i] + 0.chr
  end

  buf += 0.chr * 260

  LoadTexture.call(buf)

DLL function enter image description here

I get

Failed to load image "=»`¶È; ð¿w c H ". Reason: Unable to open

1
  • 1
    Please post error messages as text not grey on black images. Commented May 19, 2018 at 18:15

1 Answer 1

1

sfml has a ruby binding. The sfml project links to the ruby binding: https://www.sfml-dev.org/download/bindings.php. Loading textures appears to be supported by the binding.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.