From 7c3dab6af9f63e3fab4b96a349cb006d072b8422 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20=E2=80=98Touky=E2=80=99=20Huet?= Date: Wed, 25 Sep 2013 20:58:46 +0000 Subject: [PATCH] Fixed an error for Emscripten. --- src/gpu/shader.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gpu/shader.cpp b/src/gpu/shader.cpp index fc0a662b..c2b19525 100644 --- a/src/gpu/shader.cpp +++ b/src/gpu/shader.cpp @@ -352,8 +352,12 @@ Shader::Shader(char const *vert, char const *frag) GLint num_attribs; glGetProgramiv(data->prog_id, GL_ACTIVE_ATTRIBUTES, &num_attribs); +#if EMSCRIPTEN //WebGL doesn't support GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, so chose a default size value. + GLint max_len = 256; +#else GLint max_len; glGetProgramiv(data->prog_id, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, &max_len); +#endif char* name_buffer = new char[max_len]; for (int i = 0; i < num_attribs; ++i)