   VAO problem
  Hi, I have problem with VAO, I think I`ve done everything well, but it`s not working... I don`t know what is wrong, can you help me?Here`s code:init:glGenVertexArrays(1,&arrayBuffer);glBindVertexArray(arrayBuffer);glGenBuffers(1, &idv);//vertexyglBindBuffer(GL_ARRAY_BUFFER, idv);glBufferData(GL_ARRAY_BUFFER, verts*(isXYZ?3:2)*sizeof(float), vertices, GL_STATIC_DRAW);    glVertexAttribPointer((GLuint)0, 3, GL_FLOAT, GL_FALSE, 0, 0); glEnableVertexAttribArray(0);glGenBuffers(1, &idc);//tex coordsglBindBuffer(GL_ARRAY_BUFFER, idc);glBufferData(GL_ARRAY_BUFFER, verts*2*sizeof(float), coords, GL_STATIC_DRAW);    glVertexAttribPointer((GLuint)1, 2, GL_FLOAT, GL_FALSE, 0, 0); glEnableVertexAttribArray(1);glGenBuffers(1, &idn);//normalsglBindBuffer(GL_ARRAY_BUFFER, idn);glBufferData(GL_ARRAY_BUFFER,verts*3*sizeof(float), normals, GL_STATIC_DRAW);glVertexAttribPointer((GLuint)2, 3, GL_FLOAT, GL_FALSE, 0, 0); glEnableVertexAttribArray(2);glGenBuffers(1, &idi);//indicesglBindBuffer(GL_ELEMENT_ARRAY_BUFFER, idi);glBufferData(GL_ELEMENT_ARRAY_BUFFER,indices*sizeof(unsigned int), indexes, GL_STATIC_DRAW);    glEnableVertexAttribArray(3);//with or without this?render:glBindVertexArray(arrayBuffer);//buffer VAO    glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, idi);//index bufferglDrawElements(GL_TRIANGLES,indices,GL_UNSIGNED_INT,0);//index countglBindVertexArray(0);
  Use glGetError() to narrow down the problem.   ;  Also give a better description of the problem than "it's not working"   ;  GlError is 0.Quote:Also give a better description of the problem than "it's not working"I really dont't know what I can tell you more...I have no errors, verts,coords,normals and indices are the same as in VBO(which is working without any problem). Maybe I give bad macro or I use bad function somewhere?   ;  Do you just have a blank screen then?If that is the case than say so, "Not working" could mean 50 different things.Also you don't want this: "glEnableVertexAttribArray(3);//with or without this?"Indices are not a vertex attrib. Don't know if that's your only problem though.   ;  As karwosts said.glVertexAttribPointer((GLuint)0, 3, GL_FLOAT, GL_FALSE, 0, 0);This is wrong I think. You should be passing the location for the attribute in the shader program that is bound, not just an arbitrary int.Use glGetAttribLocation to get the location of an attribute from a shader and use that as argument for glVertexAttribPointer and glEnableVertexAttribArray.   ;Quote:Do you just have a blank screen then?If that is the case than say so, "Not working" could mean 50 different things.Yes it draws nothing. Quote:Also you don't want this: "glEnableVertexAttribArray(3);//with or without this?"Indices are not a vertex attrib. Don't know if that's your only problem though.Even without this its not working   ;Quote:Original post by ShintahAs karwosts said.glVertexAttribPointer((GLuint)0, 3, GL_FLOAT, GL_FALSE, 0, 0);This is wrong I think. You should be passing the location for the attribute in the shader program that is bound, not just an arbitrary int.Use glGetAttribLocation to get the location of an attribute from a shader and use that as argument for glVertexAttribPointer and glEnableVertexAttribArray.You wrote lasrt message at the same time as me:),But if i dont want to send pointers to shader? I only want to render without any vert/frag shader, just draw   ;  You should be using glVertexPointer/glNormalPointer/glTexcoordPointer instead of glVertexAttribPointer and use glEnableClientState (look up the arguments) instead of glEnableVertexAttribArray if you don't have a shader.I think they may work on some implementation if you guess the right integer, but I don't think that behavior is in the spec.   ;  But thats VBO not VAO... So can u tell me for what(for example) is VAO? I thought thats sth like VBO but for animation etc.   