Sign in to follow this  
LilBudyWizer

Why doesn't glEvalMesh2 draw anything (Resolved)

Recommended Posts

I using the following code:
void DrawLid(void)
{
    GLfloat CurrCtrl[4][4][3];

    glPushAttrib(GL_EVAL_BIT);

        glEnable(GL_MAP2_VERTEX_3);

        for (int i = 0; i < LIDPATCHS; i++)
        {
            LoadCtrl(&Lid[i][0][0], &CurrCtrl[0][0][0]);

// Draw control box

            glBegin(GL_LINES);
                for (int s = 0; s < 3; s++)
                {
                    for (int t = 0; t < 4; t++)
                    {
                        glVertex3fv((GLfloat *) &CurrCtrl[s][t][0]);
                        glVertex3fv((GLfloat *) &CurrCtrl[s+1][t][0]);
                    }
                }
            glEnd();

            glBegin(GL_LINES);
                for (int s = 0; s < 3; s++)
                {
                    for (int t = 0; t < 4; t++)
                    {
                        glVertex3fv((GLfloat *) &CurrCtrl[t][s][0]);
                        glVertex3fv((GLfloat *) &CurrCtrl[t][s+1][0]);
                    }
                }
            glEnd();

            glMap2f(GL_MAP2_VERTEX_3,
                    0.0, 1.0,  3, 4,
                    0.0, 1.0, 12, 4,
                    (GLfloat *) &CurrCtrl[0][0][0]);

            glMapGrid2f(20, 0.0, 1.0, 20, 0.0, 1.0);

// Draw manually

            glBegin(GL_TRIANGLE_STRIP);
                for (int s = 0; s < 20; s++)
                    for (int t = 0; t <= 20; t++)
                    {
                        glEvalCoord2f((GLfloat) s / 20.0, (GLfloat) t / 20.0);
                        glEvalCoord2f((GLfloat) (s+1) / 20.0, (GLfloat) t / 20.0);
                    }
            glEnd();

// Draw using mesh

            glEvalMesh2(GL_LINES, 0, 20, 0, 20);
        }

    glPopAttrib();
}


Everything draws fine except that final glEvalMesh2 command. I get the control box and even the mesh from manually using glEvalCoord2f, but not by using glEvalMesh2. If I take out the glEvalCoord2f calls I get only the control box. I'm totally baffled. Resolved: It's GL_LINE, not GL_LINES [Edited by - LilBudyWizer on November 4, 2005 12:29:20 AM]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this