Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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 ;)

like image 581
przemo_li Avatar asked Feb 24 '23 05:02

przemo_li


1 Answers

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
like image 90
Mon ouïe Avatar answered Mar 13 '23 01:03

Mon ouïe