运行时检查失败#0:为什么我得到这个以及它是什么意思?

在我的程序中(用于作业),我将一个顶点和法线等模型加载到我所拥有的结构中。 在绘制时,我将模型传递给函数void drawModel(Model model) 。 这样做会给我这个错误:

 Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention. 

我环顾四周,一个答案似乎是因为我传递的内容太大而且弄乱了编译器。 所以我尝试更改它,以便drawModel函数接受一个指向结构的指针(我应该以…开头),但是一旦我在函数中访问它,我就会得到那个错误。

我怎么能绕过这个? 为什么会发生这种情况?

这是整个function

 void drawModel(Model * model) { int i, g; //i is the main iterator, g keeps track of what part we're on int edge; //The current edge we're on g = 0; for(i = 0; i faceCount); i++) //This is just to test why it's occuring { } glEnableClientState(GL_VERTEX_ARRAY); glVertexPointer(3, GL_FLOAT, 0, model->vertices); glEnableClientState(GL_NORMAL_ARRAY); glNormalPointer(3, GL_FLOAT, 0, model->normals); for(i = 0; i faceCount); i++) //Right here is where i get the error { if(i == model->parts[g]) { //Set colour to the part colour g++; } glDrawElements(GL_POLYGON, model->faces[i].edges, GL_UNSIGNED_BYTE, model->faces[i].edge); } } 

注意:我之前从未使用过GL顶点数组,这是我的第一次尝试。

我这样调用drawModel: drawModel(&plane);

问题是

 glNormalPointer(3, GL_FLOAT, 0, model->normals); 

它应该读

 glNormalPointer(GL_FLOAT, 0, model->normals);