Ruby/Opengl and RUDL

Discussion in 'Ruby' started by Kyle Pinkman, Oct 4, 2006.

  1. Kyle Pinkman

    Kyle Pinkman Guest

    I am using RUDL, to create a 2D engine in Opengl... I cant find anything
    that would cause for this great deal of lag I am getting, other then the
    fact I have 17 polygons. I'm.. not sure why it would lag so much over
    only 17 polygons.. I do not think there are any memory leaks, because
    textures and what not are initialized once, and are pretty safe.
    Although... there is still this huge lag.. when I take away the
    polygons, the lag is gone, when I add them back in. The lag is back, and
    reasons this could be? Anything I could do to fix it? (dont ask me why
    im using opengl to make a 3D engine, I just want too. >.>'
    Kyle Pinkman, Oct 4, 2006
    1. Advertisements

  2. Kyle Pinkman

    Bill Kelly Guest


    Is the lag the same, no matter what size the polygons are? I.e. if you
    draw 17 very small polygons, does it lag still?


    Bill Kelly, Oct 4, 2006
    1. Advertisements

  3. Kyle Pinkman

    Kyle Pinkman Guest

    I was thinking it was most obviously the polygons size, and how close it
    was to the camra.. although the size it only 640x480px or 6.4x4.8...
    although, that is only two polygons. Then there are 15 small ones, with
    the width of 640px and the height of 32px that run down the window
    equalling the size of the other two larger polygons..

    The code is..
    GL.Enable GL::TEXTURE_2D
    GL.BindTexture(GL::TEXTURE_2D, @layer_2.draw);
    15.times do |i|
    w = 0.625
    h = 0.46875
    y = 0.32 * i
    oy = i * (h/15)
    GL.TexCoord 0, 0
    GL.Vertex 0, 0,1.99
    GL.TexCoord w, 0
    GL.Vertex 6.4, 0,1.99
    GL.TexCoord w,oy
    GL.Vertex 6.4, y,1.99
    GL.TexCoord 0,oy
    GL.Vertex 0.0, y,1.99
    GL.Disable GL::TEXTURE_2D
    although, thats only for the 15 polygons that run down..

    If it is(most like is) the size of the polygons, wich is causing the
    lag, is there any way to fix that?


    I am not sure what you mean..
    Kyle Pinkman, Oct 4, 2006
  4. Kyle Pinkman

    Kyle Pinkman Guest

    I do not have a graphics card.. but im not sure if that would explain
    the lagging, because I have had people test it as well and it lagged for
    them, and alot of them have nice graphics cards and lots of ram.. also,
    I have made this simular thing in c to test, and it didnt lag at all in
    C.. so im not sure.
    Kyle Pinkman, Oct 5, 2006
    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.