Problems using ruby and opengl

Discussion in 'Ruby' started by Ciph3rzer0, Apr 15, 2009.

  1. Ciph3rzer0

    Ciph3rzer0 Guest

    So I just recently started using ruby and I love it. I am also taking
    a computer graphics course and I am using C and C++ to use OpenGL. I
    did a little searching, and it seems that ruby can do OpenGL too, but
    I've had some problems...

    I get this error every time I try to call Glut.glutCreateWindow :

    freeglut ERROR: Internal error <FBConfig with necessary capabilities
    not found> in function fgOpenWindow
    X Error of failed request: BadWindow (invalid Window parameter)
    Major opcode of failed request: 4 (X_DestroyWindow)
    Resource id in failed request: 0x0
    Serial number of failed request: 25
    Current serial number in output stream: 28

    I used both my code and example code (though I haven't had much luck
    finding any). The ruby-opengl page is surprisingly unhelpful, with
    very little information and tutorials.

    Also, I've noticed that the sample programs I found haven't needed
    these two lines:

    require 'rubygems'
    gem 'ruby-opengl'

    I'm not entirely sure what's up.
    Ciph3rzer0, Apr 15, 2009
    1. Advertisements

  2. Ciph3rzer0

    Ciph3rzer0 Guest

    No ideas? Does anyone at least know how to set up ruby so that I
    don't need to add :

    require 'rubygems'
    gem 'ruby-opengl'

    to the beginning of a program?
    Ciph3rzer0, Apr 15, 2009
    1. Advertisements

  3. You need this env var:

    Joel VanderWerf, Apr 15, 2009
  4. Ciph3rzer0

    Bill Kelly Guest

    One thing that seems odd there, is freeglut claiming the
    problem is an "Internal error".

    Had you already seen the tutorial page?

    It mentions the ability to use SDL or GLFW to obtain a
    window, instead of GLUT. Unless GLUT is a fixed
    requirement for you, maybe you could sidestep the issue
    that way?


    Bill Kelly, Apr 15, 2009
  5. Ciph3rzer0

    Ciph3rzer0 Guest

    I don't really know how to use anything else...
    Does it seem like a problem with ruby-opengl? Or freeglut? are there
    other "glut"s I can use?
    Ciph3rzer0, Apr 21, 2009
  6. Ciph3rzer0

    Bill Kelly Guest

    You would still be using OpenGL... Unless you are doing
    anything fancy with the window itself (menus, etc.) then
    SDL or GLFW can be regarded as merely alternate ways to
    obtain a window for rendering with OpenGL.

    I'm not sure how to guess where the problem lies. I would
    tend to suspect the ruby bindings, however I did find it
    curious that the error message came from freeglut and
    described itself as an "internal error".

    Coincidentally, a relese candidate for freeglut version
    2.6.0 was just put online today:

    So you might try compiling that new version of freeglut
    and see if you can get any of its C-based demos to work.
    If the C-based demos work, but the ruby bindings still
    produce the error, then we may have narrowed it down a

    Hope this helps,

    Bill Kelly, Apr 21, 2009
  7. Ciph3rzer0

    Ciph3rzer0 Guest

    well, I have tried using C with freeglut, and I can created windows
    and such. So I guess that already means it's a problem with the

    I *am* in the process of compiling ruby 1.9. I figured since it said
    the bindings have been updated for 1.9, then that might be the problem.
    Ciph3rzer0, Apr 21, 2009
  8. Ciph3rzer0

    Ciph3rzer0 Guest

    Using ruby 1.9 has fixed the problem for me. Thanks everyone for your
    Ciph3rzer0, Apr 22, 2009
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.