add some opengl functions here, for now

This commit is contained in:
matcool 2023-09-17 15:01:34 -03:00
parent 19b0f72634
commit e7e5ee7f26
2 changed files with 15 additions and 0 deletions
loader
CMakeLists.txt
src/platform/android

View file

@ -149,6 +149,11 @@ if (APPLE)
file(COPY ${GEODE_LOADER_PATH}/include/link/libfmod.dylib DESTINATION ${GEODE_BIN_PATH}/nightly)
endif()
if (ANDROID)
# needed to define some opengl functions
target_link_libraries(${PROJECT_NAME} EGL)
endif()
target_include_directories(${PROJECT_NAME} PRIVATE
src/
src/loader/

View file

@ -5,7 +5,17 @@
#include "../load.hpp"
#include <jni.h>
// idk where to put this
#include <EGL/egl.h>
PFNGLGENVERTEXARRAYSOESPROC glGenVertexArraysOESEXT = 0;
PFNGLBINDVERTEXARRAYOESPROC glBindVertexArrayOESEXT = 0;
PFNGLDELETEVERTEXARRAYSOESPROC glDeleteVertexArraysOESEXT = 0;
extern "C" [[gnu::visibility("default")]] jint JNI_OnLoad(JavaVM* vm, void* reserved) {
glGenVertexArraysOESEXT = (PFNGLGENVERTEXARRAYSOESPROC)eglGetProcAddress("glGenVertexArraysOES");
glBindVertexArrayOESEXT = (PFNGLBINDVERTEXARRAYOESPROC)eglGetProcAddress("glBindVertexArrayOES");
glDeleteVertexArraysOESEXT = (PFNGLDELETEVERTEXARRAYSOESPROC)eglGetProcAddress("glDeleteVertexArraysOES");
geodeEntry(nullptr);
return JNI_VERSION_1_1;
}