GL_LINE_STIPPLE running slowly...

Started by Rasengan, May 29, 2006, 16:21:04

Previous topic - Next topic

Rasengan

hey all!
I'm drawing a few lines using GL_LINE_STIPPLE and my application framerate is running very slowly...is it due to a problem with LWJGL implementation of this function or is it due to a problem with my code?

...
// ready to draw something...

  float lineWidth = 0.5f;
  float yPos = 3f;
  glEnable(GL_LINE_STIPPLE); // enable stippling
  short stipplePattern = (short)0xAAAA; // 0xAAAA = 1010 1010 1010 1010
  glLineStipple(2, stipplePattern);// Set the stipple patten.
  for (float line = 0f; line < 7f; line+= 0.5f) {
    glLineWidth(lineWidth);	
	
    glBegin(GL_LINES);
      glVertex3f(1f, yPos, 0f);
      glVertex3f(4f, yPos, 0f);
    glEnd();	
	
    yPos-= 0.5f;
    lineWidth+= 0.5f;
  }
  glDisable(GL_LINE_STIPPLE); // disable stippling.
...

darkprophet

Nothing is wrong with your code at an initial glance, but LWJGL isn't at fault either. Its mainly the driver...

Drawing lines is harder than you think, and even the latest HW has perf problems with drawing lines (just as Kevglass found out when he had performance problem with Tiltilation). Just wait for a better driver/gfx card, or not use lines :)

DP