Browse Source

Fixed an error for Emscripten.

undefined
Benjamin ‘Touky’ Huet Sam Hocevar <sam@hocevar.net> 11 years ago
parent
commit
7c3dab6af9
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      src/gpu/shader.cpp

+ 4
- 0
src/gpu/shader.cpp View File

@@ -352,8 +352,12 @@ Shader::Shader(char const *vert, char const *frag)
GLint num_attribs; GLint num_attribs;
glGetProgramiv(data->prog_id, GL_ACTIVE_ATTRIBUTES, &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; GLint max_len;
glGetProgramiv(data->prog_id, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, &max_len); glGetProgramiv(data->prog_id, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, &max_len);
#endif


char* name_buffer = new char[max_len]; char* name_buffer = new char[max_len];
for (int i = 0; i < num_attribs; ++i) for (int i = 0; i < num_attribs; ++i)


Loading…
Cancel
Save