I'm not a native English speaker, so I apologize for any strange English.
Table of contents
Summary
About Error
About Fix
Summary
On Windows PC, I cannot load glfw3.dll because the argument of GLFW.load_lib(file, path) is wrong.
This pull request adds a method for the Windows platform so that glfw3.dll can be loaded.
About Error
When I use mittsu on a windows PC, I get a type error in opengl-bindings/glfw.rb.
# main.rb
require 'mittsu'
# Powershell script to set env and run main.rb.
$ENV:MITTSU_LIBGLFW_PATH = "C:\Users\username\lib-mingw-w64"
# or $ENV:MITTSU_LIBGLFW_PATH = "C:\Users\username\lib-mingw-w64\glfw3.dll"
bundle exec ruby main.rb
# Error log
C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/opengl-bindings-1.6.11/lib/glfw.rb:505:in `+': no implicit conversion of nil into String (TypeError)
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/opengl-bindings-1.6.11/lib/glfw.rb:505:in `load_lib'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/mittsu-0.3.3/lib/mittsu/renderers/glfw_window.rb:8:in `<top (required)>'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/mittsu-0.3.3/lib/mittsu/renderers/opengl_renderer.rb:9:in `require'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/mittsu-0.3.3/lib/mittsu/renderers/opengl_renderer.rb:9:in `<top (required)>'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/mittsu-0.3.3/lib/mittsu/renderers.rb:1:in `require'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/mittsu-0.3.3/lib/mittsu/renderers.rb:1:in `<top (required)>'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/mittsu-0.3.3/lib/mittsu.rb:11:in `require'
from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/mittsu-0.3.3/lib/mittsu.rb:11:in `<top (required)>'
from main.rb:1:in `require'
from main.rb:1:in `<main>'
On Windows OS, this error occurs when calling GLFW.load_lib(nil, ENV["MITTSU_LIBGLFW_PATH"]) because it is not the expected argument.
I'm not a native English speaker, so I apologize for any strange English.
Table of contents
Summary
On Windows PC, I cannot load
glfw3.dll
because the argument ofGLFW.load_lib(file, path)
is wrong.This pull request adds a method for the Windows platform so that
glfw3.dll
can be loaded.About Error
When I use mittsu on a windows PC, I get a type error in
opengl-bindings/glfw.rb
.On Windows OS, this error occurs when calling
GLFW.load_lib(nil, ENV["MITTSU_LIBGLFW_PATH"])
because it is not the expected argument.mittsu glfw_window.rb
opengl-bindings glfw.rb
About Fix
I believe this problem can be solved by defining a method for windows os in "glfw_lib.rb".
Expected Behavior