use of undeclared identifier 'glBindVertexArrayOES'

23 views
Skip to first unread message

Lu Quest

unread,
Jul 10, 2024, 2:08:37 PM7/10/24
to emscripten-discuss
Hi, I am trying to build an OpenGL ES 2 app with imgui, but get

error: use of undeclared identifier 'glBindVertexArrayOES'

Looking in backends/imgui_impl_opengl3.cpp, it seems it is attempting to turn them on, claiming emscripten uses an extension:

// Vertex arrays are not supported on ES2/WebGL1 unless Emscripten, which uses an extension
#ifndef IMGUI_IMPL_OPENGL_ES2
#define IMGUI_IMPL_OPENGL_USE_VERTEX_ARRAY
#elif defined(__EMSCRIPTEN__)
#define IMGUI_IMPL_OPENGL_USE_VERTEX_ARRAY
#define glBindVertexArray       glBindVertexArrayOES
#define glGenVertexArrays       glGenVertexArraysOES
#define glDeleteVertexArrays    glDeleteVertexArraysOES
#define GL_VERTEX_ARRAY_BINDING GL_VERTEX_ARRAY_BINDING_OES
#endif

but it seems those extensions are not found.

I'm compiling with -sUSE_SDL=2 -sFULL_ES2

I'd be grateful for suggestions.

Thanks,

Luke
Reply all
Reply to author
Forward
0 new messages