glVertex2f vs glVertex3f

Discussion in 'Mac Programming' started by Blakeasd, Sep 4, 2011.

  1. Blakeasd macrumors 6502a

    Joined:
    Dec 29, 2009
    #1
    I am just beginning to learn OpenGL so I went to look at the Golden Triangle example on Apple's Developer website. When they drew the triangle they used glVertex3f and for the third parameter they used "0". I was using Xcode's auto-completion and I noticed "glVertex2f" and saw there were only two parameters "x" and "y". So I used it and it worked. Is there a reason Apple used glVertex3f and put the z parameter as "0" rather than just using glVertex2f? Is there some sort of disadvantage to using glVertex2f if you don't need the "z" parameter?
    Thanks!
     
  2. lloyddean macrumors 6502a

    Joined:
    May 10, 2009
    Location:
    Des Moines, WA
  3. Blakeasd thread starter macrumors 6502a

    Joined:
    Dec 29, 2009
    #3
    Thanks! I just wanted to make sure I didn't do anything that would hurt performance or cause future problems.
     

Share This Page