问题
I've looked everywhere, but there seam to be no ruby binding that would allow to create OpenGL 3/4 context.
It do not have to be complete OpenGL binding library, just portion that creates OpenGL context.
Update: If I'm desperate enough I'll do partial glfw ruby binding with ruby ffi. So pls save me from that ;)
回答1:
I have written a library that can create an OpenGL 3 or 4 context on most platforms (provided it is supported). It's called Ray. You don't have to use its drawable system or DSL, you can just use it to create a window and an OpenGL context.
Ray::GL.major_version = 3
Ray::GL.minor_version = 2
Ray::GL.core_profile = true # if you want/need one
window = Ray::Window.new("test", [640, 480])
window.make_current
# You can make OpenGL calls yourself now
来源:https://stackoverflow.com/questions/7133319/how-to-create-opengl-3-x-or-4-x-context-in-ruby