OpenGL c++ problem

  • Alphoenix
    Likes 0

    Problem Description

    I’m watching the tutorials on modern opengl in c++ and i’ve some trouble to understand the following line of code:

    glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 8 * sizeof(GLfloat), (GLvoid *)0);

    why the ‘8 * sizeof(GLfloat)’ and why ‘(GLvoid* )0’ and not just 0 ?

  • Sonar Systems admin
    Likes 0

    Which lesson are you on?

  • Alphoenix
    Likes 0

    Im at the beginning of the fourth tutorial. 

  • Sonar Systems admin
    Likes 0

    What platform are you watching the lessons on?

  • Alphoenix
    Likes 0

    on windows10 with vs2017 as IDE

  • Sonar Systems admin
    Likes 0

    I mean what website sorry?

  • Alphoenix
    Likes 0

    im watching on youtube the opengl tutorials

  • Sonar Systems admin
    Likes 0

    Is it the transformations video?

  • Alphoenix
    Likes 0

    yes it is !

  • Sonar Systems admin
    Likes 0

    8 vertices

     

    Also OpenGL has it’s own variables so always best to use them or cast to them.

Login to reply