PDA

View Full Version : primitives optimization problem



Sickboy
01-06-2004, 01:14 AM
Hi guys,

i need to optimize following code:

for (int j = 1; j < iAnzahlPunkte; j++)
{
glPushName(j);
glBegin(GL_LINES);
GLfloat iObjx = X_ToOpenGL (MyVector[i][j-1][1]);
GLfloat iObjy = Y_ToOpenGL (MyVector[i][j-1][2]);
glVertex2f(iObjx,iObjy);
iObjx = X_ToOpenGL (MyVector[i][j][1]);
iObjy = Y_ToOpenGL (MyVector[i][j][2]);
glVertex2f(iObjx,iObjy);
glEnd();
glPopName();
}

I know that itīs better to put all vertex inside the for loop and glBegin/glEnd outside the for loop.
But how can i assign the glPushName in this case to the single primitives ?

Thx in advance

ZbuffeR
01-06-2004, 03:11 AM
You can not.
You have to choose http://www.opengl.org/discussion_boards/ubb/smile.gif