Issue
i am trying to get the current OpenGL context on android in c++.
but i get a compile time error, how can i get the current context?
the error:
undefined reference to eglGetCurrentContext()
the code:
#include <GLES2/gl2.h>
#include <EGL/egl.h>
void foo()
{
EGLContext ctx = eglGetCurrentContext();
}
Solution
You are missing libEGL from your make file library list.
Assuming you are using CMake files, you need something like this in your make file:
# Include libraries needed
target_link_libraries(
GLESv2
EGL)
Note GLESv2
not needed for this error, but given you include the GLES2 header, it's likely you'll need the GLESv2 library at some point ...
Answered By - solidpixel
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.