How to create OpenGL 3.x or 4.x context in Ruby?

2019-05-06 14:31发布

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条回答
等我变得足够好
2楼-- · 2019-05-06 14:52

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
查看更多
登录 后发表回答