cancel
Showing results for 
Search instead for 
Did you mean: 

call func in gl2ext.h failed

forhk0423
Explorer
I aimed to seperate MoviePlay part from the sdk so I can use them to play movie in unity as a c++ plugin.
when I use them in Unity, I meet the problem,when calling "glGenVertexArraysOES_( 1, &vertexArrayObject );" in GLGeometry.cpp, the unity app just crashed .
the logcat when crash:
http://i1.tietuku.com/4aee500ec0a46294.png
Something about the func:
in GlUtils.cpp:
PFNGLGENVERTEXARRAYSOESPROC glGenVertexArraysOES_;
in gl2ext.h:
typedef void (GL_APIENTRYP PFNGLGENVERTEXARRAYSOESPROC) (GLsizei n, GLuint *arrays);
I guess because i didn't include -lGLESv2 in android.mk but still not work.
below is my android.mk

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

APP_MOUDLE := oculus

LOCAL_MODULE := OculusPlugin #generate liboculus.so

LOCAL_ARM_MODE := arm

#
LOCAL_LDLIBS := -L$(SYSROOT)/usr/lib -lGLESv2
LOCAL_LDLIBS += -L$(SYSROOT)/usr/lib -lGLESv3
LOCAL_LDLIBS += -L$(SYSROOT)/usr/lib -lEGL
LOCAL_LDLIBS += -L$(SYSROOT)/usr/lib -llog
LOCAL_LDLIBS += -L$(SYSROOT)/usr/lib -landroid

include $(LOCAL_PATH)/../cflags.mk


#LOCAL_ALLOW_UNDEFINED_SYMBOLS := true
LOCAL_C_INCLUDES := $(LOCAL_PATH)/Kernel/ \
$(LOCAL_PATH)/




LOCAL_SRC_FILES := GlGeometry.cpp \
GlProgram.cpp \
GLUtils.cpp \
SurfaceTexture.cpp \
Log.cpp \
MediaSurface.cpp\
UnityPlugin.cpp \
Vsync.cpp \
Kernel/OVR_Alg.cpp \
Kernel/OVR_Allocator.cpp \
Kernel/OVR_Atomic.cpp \
Kernel/OVR_File.cpp \
Kernel/OVR_FileFILE.cpp \
Kernel/OVR_Lockless.cpp \
Kernel/OVR_Log.cpp \
Kernel/OVR_Math.cpp \
Kernel/OVR_RefCount.cpp \
Kernel/OVR_Std.cpp \
Kernel/OVR_String.cpp \
Kernel/OVR_String_FormatUtil.cpp \
Kernel/OVR_String_PathUtil.cpp \
Kernel/OVR_SysFIle.cpp \
Kernel/OVR_System.cpp \
Kernel/OVR_ThreadsPthread.cpp \
Kernel/OVR_Timer.cpp \
Kernel/OVR_TypesafeNumber.cpp \
Kernel/OVR_UTF8Util.cpp




LOCAL_EXPORT_LDLIBS := -lGLESv2

#opengl es 3.0
LOCAL_EXPORT_LDLIBS += -lGLESv3

#GL platform interface
LOCAL_EXPORT_LDLIBS += -lEGL

#native multimedia
LOCAL_EXPORT_LDLIBS += -lOpenMAXAL
#logging
LOCAL_EXPORT_LDLIBS += -llog
#native windosw
LOCAL_EXPORT_LDLIBS += -landroid

include $(BUILD_SHARED_LIBRARY)


#$(call import-module 3rdParty/turbojpeg)



by the way , it's inconvenient to build a .so plugin and use them in unity everytime when debug.(though with a .bat file)
is there any other way to debug the program such as use breakpoint.
thanks in advance. 😄
4 REPLIES 4

cybereality
Grand Champion
Can you provide the full logcat as a text file attachment? It's a little difficult to debug from an image.
AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV

forhk0423
Explorer
thanks for answering cybereality,this is the logcat.
http://home.ustc.edu.cn/~sg513138/log.txt

forhk0423
Explorer
"cybereality" wrote:
Can you provide the full logcat as a text file attachment? It's a little difficult to debug from an image.

Sorry ,I've solved the problem.
In UnityPlugin.cpp void OVR_InitRenderThread() ,at the very beginning I delete "GL_FindExtensions();" ,this func redefined the "glGenVertexArraysOES_ " .Now I add it and the problem gone.
But more problem may coming up .haha
thanks.

cybereality
Grand Champion
Thanks for following up.
AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV