• Paladin of the Pegasos
    Paladin of the Pegasos
    Jupp3
    Posts: 1193 from 2003/2/24
    From: Helsinki, Finland
    Quote:

    pRGB = malloc(sizeof(unsigned char)*4);

    Why this instead of unsigned char pRGB[4]? I wouldn't use malloc, especially if that's "per-pick"
    Quote:


    glBegin(GL_QUADS);
    glVertex3f( -0.5f, -0.5f, +0.5f);
    glVertex3f( +0.5f, -0.5f, +0.5f);
    glVertex3f( +0.5f, +0.5f, +0.5f);
    glVertex3f( -0.5f, +0.5f, +0.5f);
    glEnd();


    I'd highly recommend using vertex arrays instead of slow, deprecated and often impractical immediate mode. Also, if some day tinygl is improved to support VBO, then you can get some serious speedup from modifying the vertex array code to use VBO instead (it's basically only a few additional function calls around what you have in vertex arrays.)
  • »16.06.11 - 12:41
    Profile Visit Website