Skip to content

Commit

Permalink
Support android
Browse files Browse the repository at this point in the history
  • Loading branch information
lisyarus committed Jul 17, 2023
1 parent 4fa3a0f commit 7c2b901
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,8 @@ def write_features(f):
#include <stdio.h>
#elif defined(_WIN32)
#include <windows.h>
#elif defined(__ANDROID__)
#include <EGL/egl.h>
#else
#include <GL/glx.h>
#endif
Expand Down Expand Up @@ -438,6 +440,13 @@ def write_features(f):
\treturn reinterpret_cast<void*>(GetProcAddress(image, reinterpret_cast<LPCSTR>(name)));
}
#elif defined(__ANDROID__)
static void * get_proc_address(const char *func)
{
\treturn reinterpret_cast<void *>(eglGetProcAddress(func));
}
#else // GLX
Expand Down
9 changes: 9 additions & 0 deletions gl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
#include <stdio.h>
#elif defined(_WIN32)
#include <windows.h>
#elif defined(__ANDROID__)
#include <EGL/egl.h>
#else
#include <GL/glx.h>
#endif
Expand Down Expand Up @@ -77,6 +79,13 @@ namespace gl

return reinterpret_cast<void*>(GetProcAddress(image, reinterpret_cast<LPCSTR>(name)));
}

#elif defined(__ANDROID__)

static void * get_proc_address(const char *func)
{
return reinterpret_cast<void *>(eglGetProcAddress(func));
}

#else // GLX

Expand Down

0 comments on commit 7c2b901

Please sign in to comment.