Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8335729
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T03:45:33+00:00 2026-06-09T03:45:33+00:00

I am just starting to learn OpenGL today from this tutorial: http://openglbook.com/the-book/ I got

  • 0

I am just starting to learn OpenGL today from this tutorial: http://openglbook.com/the-book/
I got to chapter 2, where I draw a triangle, and I understand everything except VAOs (is this acronym OK?). The tutorial has this code:

glGenVertexArrays(1, &VaoId);
glBindVertexArray(VaoId);

While I understand that the code is necessary, I have no clue what it does. Although I never use VaoId past this point (except to destroy it), the code does not function without it. I am assuming this is because it is required to be bound, but I don’t know why. Does this exact code just need to be part of every OpenGL program? The tutorial explains VAOs as:

A Vertex Array Object (or VAO) is an object that describes how the vertex attributes are stored in a Vertex Buffer Object (or VBO). This means that the VAO is not the actual object storing the vertex data, but the descriptor of the vertex data. Vertex attributes can be described by the glVertexAttribPointer function and its two sister functions glVertexAttribIPointer and glVertexAttribLPointer, the first of which we’ll explore below.

I don’t understand how the VAO describes the vertex attributes. I have not described them in any way. Does it get the information from the glVertexAttribPointer? I guess this must be it. Is the VAO simply a destination for the information from glVertexAttribPointer?

On a side note, is the tutorial I am following acceptable? Is there anything I should watch out for or a better tutorial to follow?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T03:45:34+00:00Added an answer on June 9, 2026 at 3:45 am

    “Vertex Array Object” is brought to you by the OpenGL ARB Subcommittee for Silly Names.

    Think of it as a geometry object. (As an old time SGI Performer programmer, I call them geosets.) The instance variables/members of the object are your vertex pointer, normal pointer, color pointer, attrib N pointer, …

    When a VAO is first bound, you assign these members by calling

    glEnableClientState(GL_VERTEX_ARRAY); glVertexPointer...;
    glEnableClientState(GL_NORMAL_ARRAY); glNormalPointer...;
    

    and so on. Which attributes are enabled and the pointers you supply are stored in the VAO.

    After that when you bind the VAO again, all the those attributes and pointers also become current. So one glBindVertexArray call is equivalent to all the code previously needed to set up all the attributes. It’s handy for passing geometry around between functions or methods without having to create your own structs or objects.

    (One time setup, multiple use is the easiest way to use VAOs, but you can also change attributes just by binding it and doing more enable/pointer calls. VAOs are not constants.)

    More info in response to Patrick’s questions:

    The default for a newly created VAO is that it’s empty (AFAIK). No geometry at all, not even vertexes, so if you try to draw it, you’ll get an OpenGL error. This is reasonably sane, as in “initialize everything to False/NULL/zero”.

    You only need to glEnableClientState when you set things up. The VAO remembers the enable/disable state for each pointer.

    Yes the VAO will store glEnableVertexAttribArray and glVertexAttrib. The old vertex, normal, color, … arrays are the same as attribute arrays, vertex == #0 and so on.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am just starting to learn C, this is probably a very easy question
Hi just starting to learn this language, more of a javascript/PHP guy... I can't
Just starting to learn scala for a new project. Have got to the point
I am just starting to learn jQuery, and want to load content from a
im just starting to learn about sockets and i have been given this code,
I'm just starting to learn web dev, but got myself a bit confused when
I'm just starting to learn to use HashMap and reading the java tutorial, but
Hi I'm just starting to learn Python, I'm using the book learn python the
I'm just starting to learn intel assembly and I'm having trouble with this simple
Just starting to learn the Java side of things, sorry if this is obvious.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.