vaiorabbit / ruby-opengl

Yet another OpenGL wrapper for Ruby (and wrapper code generator).
Other
86 stars 11 forks source link

Fix signature for glfwSetMonitorUserPointer #32

Closed danini-the-panini closed 3 years ago

danini-the-panini commented 3 years ago

Fiddle importer is raising an error that const is not a type when parsing the signature of glfwSetMonitorUserPointer. Removing the const fixes this. Based on GLFW's header files, this is correct since it does not have a const in the signature: https://github.com/glfw/glfw/blob/814b7929c5add4b0541ccad26fb81f28b71dc4d8/include/GLFW/glfw3.h#L2222

danini-the-panini commented 3 years ago

I am using the following workaround for now:

GLFW.class_variable_get('@@lib_signature').each do |sig|
  sig.gsub!(/const void(?!\s*\*)/, 'void')
end

It replaces any instance of const void that is not immediately followed by an asterisk (*) with just void. Make sure you put this snippet before calling GLFW.load_lib

vaiorabbit commented 3 years ago

Thank you for reporting!

vaiorabbit commented 3 years ago

Just released opengl-bindings-1.6.11 ( https://rubygems.org/gems/opengl-bindings/versions/1.6.11 ).