自从迁移到 64 位以来,我在随机 glVertexAttribArray 调用中收到来自 nvoglv64.dll 的



标题上到底说了什么。在我的所有库中移动并包含到 64 位,使我能够在 64 位中使用 assimp,但现在我随机收到来自 nvogl64.dll 的访问违规。它总是在glVertexAttribPointer通话中,但随机的,有时我可以运行整整 30 分钟,大多数时候它是第一次或第二次调用。我可能做错了什么?这是我的 VAO 生成完整性方法。

GLuint vertsVBO = 0;
GLuint normsVBO = 0;
GLuint textsVBO = 0;
GLuint shapeVAO = 0;
//Make the VAO
glGenVertexArrays(1, &shapeVAO);
glBindVertexArray(shapeVAO);

//Setup the Vertex buffer
glGenBuffers(1, &vertsVBO);
glBindBuffer(GL_ARRAY_BUFFER, vertsVBO);
glBufferData(GL_ARRAY_BUFFER, sizeof(float*)*uniqueVertexes * 3, indexedPoints, GL_STATIC_DRAW);
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, (const GLvoid*)0);
glEnableVertexAttribArray(0);

//The normal Buffer
glGenBuffers(1, &normsVBO);
glBindBuffer(GL_ARRAY_BUFFER, normsVBO);
glBufferData(GL_ARRAY_BUFFER, sizeof(float*)*uniqueVertexes * 3, indexedNorms, GL_STATIC_DRAW);
glVertexAttribPointer(2, 3, GL_FLOAT, GL_FALSE, 0, (const GLvoid*)0);
glEnableVertexAttribArray(2);

//and the texture co-ord buffer
glGenBuffers(1, &textsVBO);
glBindBuffer(GL_ARRAY_BUFFER, textsVBO);
glBufferData(GL_ARRAY_BUFFER, sizeof(float*)*uniqueVertexes * 2, indexedTexts, GL_STATIC_DRAW);
glVertexAttribPointer(8, 2, GL_FLOAT, GL_FALSE, 0, (const GLvoid*)0);
glEnableVertexAttribArray(8);

glGenBuffers(1, &tangentsVBO);
glBindBuffer(GL_ARRAY_BUFFER, tangentsVBO);
glBufferData(GL_ARRAY_BUFFER, sizeof(float*)*uniqueVertexes * 4, indexedTangents, GL_STATIC_DRAW);
glVertexAttribPointer(3, 4, GL_FLOAT, GL_FALSE, 0, (const GLvoid*)0);
glEnableVertexAttribArray(3);
glGenBuffers(1, &bitangentsVBO);
glBindBuffer(GL_ARRAY_BUFFER, bitangentsVBO);
glBufferData(GL_ARRAY_BUFFER, sizeof(float*)*uniqueVertexes * 4, indexedBitangents, GL_STATIC_DRAW);
glVertexAttribPointer(4, 4, GL_FLOAT, GL_FALSE, 0, (const GLvoid*)0);
glEnableVertexAttribArray(4);
glGenBuffers(1, &indicesVBO);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, indicesVBO);
glBufferData(GL_ELEMENT_ARRAY_BUFFER, indicesLength * sizeof(GLuint), indices, GL_STATIC_DRAW);

//Unbind VAO
glBindVertexArray(0);

谢谢

你确定吗?

sizeof(float*)

我本以为你会加载浮标(而不是指针(

glBufferData(GL_ARRAY_BUFFER, sizeof(float)*uniqueVertexes * 3, indexedNorms, GL_STATIC_DRAW);

相关内容

  • 没有找到相关文章

最新更新