Advertisement

One last error compiling lesson 1 - regarding glViewPort(...)

Started by July 30, 2004 12:51 PM
2 comments, last by mdewan 20 years, 4 months ago
After taking the advice of a forum member this morning I recompiled as a C++ project and got my total # of errors to about 9 (from 28). Now I'm down to the last one, but I'm totally stuck on it! The error says this: window.c:26. implicit declaration of function 'int glViewPort(...)' Here's my entire ReSizeGLScene function:

GLvoid ReSizeGLScene(GLsizei width, GLsizei height)
{
    if(height == 0)
    {
        height = 1;
    }

    glViewPort(0, 0, width, height);  // THIS IS THE ERROR LINE - # 26
    glMatrixMode(GL_PROJECTION);  // Select the Projection Matrix
    glLoadIdentity();  // Reset the Projection Matrix

    // Calculate the Aspect Ratio of the Window
    gluPerspective(45.0f, (GLfloat)width / (GLfloat)height, 0.1f, 100.0f);

    glMatrixMode(GL_MODELVIEW);  // Select the Modelview Matrix
    glLoadIdentity();  // Reset the Modelview Matrix
}
Now I checked out this function on the web and apparently it's supposed to return void. So why does dev-c++ think otherwise? I'm not really sure what to do. Thanks
It's glViewport, not glViewPort. Identifiers are case sensitive.
Advertisement
glViewport (0, 0, width, height);
______________________________________________________________________________________The Phoenix shall arise from the ashes... ThunderHawk -- ¦þ"So. Any n00bs need some pointers? I have a std::vector<n00b*> right here..." - ZahlmanMySite | Forum FAQ | File Formats______________________________________________________________________________________
Wow, thanks so much guys. Dumb mistake on my end, but it happens. My window now works perfectly!

Again, thanks guys.

This topic is closed to new replies.

Advertisement