Reputation: 13
I can't even explaing it properly.. So I have code like
printf_s("%s", "1");
glDrawElements(GL_TRIANGLES, model.IndCount, GL_UNSIGNED_INT, (void*)0);
printf_s("%s", "2");
eglSwapBuffers ( esContext->eglDisplay, esContext->eglSurface);
And 2 is never printed .When i remove glDrawElements it's all ok
Upvotes: 1
Views: 118
Reputation: 52166
glDrawElements(GL_TRIANGLES, model.IndCount, GL_UNSIGNED_INT, (void*)0);
^^^^^^^^^^^^^^^ whaaaaat?
OpenGL ES' glDrawElements()
does not accept GL_UNSIGNED_INT
for type
, just GL_UNSIGNED_BYTE
or GL_UNSIGNED_SHORT
.
If you check glGetError()
after that call you should get a GL_INVALID_ENUM
.
Upvotes: 1
Reputation: 218090
glDrawElements(GL_TRIANGLES, model.IndCount, GL_UNSIGNED_INT, (void*)0);
crashes, so next statements are never executed.
give a correct 4th parameter to glDrawElements to fix your crash.
Upvotes: 0
Reputation: 27577
Try printf
instead of printf_s
(which will stop printing if any of it's constraints are violated -- which may very well be what glDrawElements
is doing) and flush stdout
after each print.
Upvotes: 0