Quantcast
Channel: GameDev.net
Viewing all articles
Browse latest Browse all 16874

performance drop when drawing a line in OpenGL

$
0
0

I tried to draw a simple line in OpenGL, the code below

void display(void)
{
    glClear(GL_COLOR_BUFFER_BIT);
    glLoadIdentity();

    gluLookAt(0.0, 50.0f , 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, -1.0);

    glBegin(GL_LINES);
    glVertex3f(0.0f, 0.0f, 0.0f);
    glVertex3f(50.0f, 50.0f, 50.0f);
    glEnd();

    //glutWireSphere(20.0f, 20.0f, 20.0f);

    glutSwapBuffers();
    glFlush();
}

However, when I run the program, the performance drop significantly then after a few seconds, it stops responding (I have to run task manager and force quit the program). However, when I disable the line and draw …


Viewing all articles
Browse latest Browse all 16874

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>