4

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

przemo_li
  • 3,932
  • 4
  • 35
  • 60

1 Answers1

8

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
Mon ouïe
  • 948
  • 5
  • 6
  • 1
    Do I need all dependencies, if I'll only use context creation stuff? Do you use GLEW for context creation, right? And which OpenGL is used by Ray renderer? PS if I'm able to set up bounty ill put 50 on it, but I do not know how :( – przemo_li Aug 20 '11 at 19:42
  • It uses whatever version the windowing library gives (passing arguments to configure it). It essentially needs OpenGL 2.1 to work, but could work provided some extensions (loaded through GLEW indeed). As everything is a single gem, yes, you'd have to get all of the dependencies to be able to use it. – Mon ouïe Aug 20 '11 at 19:51
  • So you use C GLEW not some ruby binding? – przemo_li Aug 20 '11 at 20:02
  • Right — the lowest level part is written in C. – Mon ouïe Aug 20 '11 at 20:32
  • There seam to be no better alternative for pure Ruby OpenGL context creation, that is kept up-to-date. Ok now I can give bounty, so you just have too wait ;) – przemo_li Aug 27 '11 at 11:56
  • I still do not know if I choose your lib, but its good solution. [I may end up doing my own glfw ruby bindings] – przemo_li Sep 03 '11 at 14:13