Bill Kelly wrote:
> From: "Kyle Pinkman" <pinkmanonfire / gmail.com>
>>
>>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. >.>'
> 
> Hi,
> 
> 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?
> 
> 
> 
> Regards,
> 
> Bill

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.PushMatrix
      GL.Enable GL::TEXTURE_2D
        GL.BindTexture(GL::TEXTURE_2D, @layer_2.draw);
        15.times do |i|
          GL.Begin(GL::QUADS);
            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.End();
          end
      GL.Disable GL::TEXTURE_2D
    GL.PopMatrix
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?

...

and..

>You're gonna have to post your drawing code. Also, do you have a GFX? or 
>are
>you running through Mesa?

I am not sure what you mean..


-- 
Posted via http://www.ruby-forum.com/.