Fix exception being thrown on empty glBegin()-glEnd() blocks. Closes #3693.
This commit is contained in:
Родитель
615f7a96e3
Коммит
3e0b69d28a
|
@ -5525,6 +5525,7 @@ var LibraryGL = {
|
|||
|
||||
// Generate index data in a format suitable for GLES 2.0/WebGL
|
||||
var numVertexes = 4 * GLImmediate.vertexCounter / GLImmediate.stride;
|
||||
if (!numVertexes) return;
|
||||
#if ASSERTIONS
|
||||
assert(numVertexes % 1 == 0, "`numVertexes` must be an integer.");
|
||||
#endif
|
||||
|
|
|
@ -146,6 +146,10 @@ int main(int argc, char *argv[])
|
|||
glTexCoord2f(1, 1 ); glVertex3f(630, 400, 0);
|
||||
glEnd();
|
||||
|
||||
// Test https://github.com/kripken/emscripten/issues/3693
|
||||
glBegin( GL_TRIANGLES );
|
||||
glEnd();
|
||||
|
||||
SDL_GL_SwapBuffers();
|
||||
|
||||
#ifndef __EMSCRIPTEN__
|
||||
|
|
Загрузка…
Ссылка в новой задаче