gpt4 book ai didi

android-ndk,找不到 glGenVertexArraysOES

转载 作者:行者123 更新时间:2023-12-04 03:19:02 24 4
gpt4 key购买 nike

我想在我的 Android 原生 C 应用程序中使用 VAO。

问题是,GL_OES_vertex_array_object支持,我什至可以得到glBindVertexArrayOES的地址和 glDeleteVertexArraysOES但是 glGenVertexArraysOES没有找到。

是否存在GL_OES_vertex_array_object意味着所有这些功能都可以访问?

我的 VAO 初始化代码:

std::string vao = "GL_OES_vertex_array_object";

if ( isExtensionSupported ( vao.c_str () ) != 0 )
{
LOG ( vao << " supported" );
glBindVertexArrayOES = (PFNGLBINDVERTEXARRAYOESPROC)eglGetProcAddress ( "glBindVertexArrayOES" );
if ( !glBindVertexArrayOES )
LOG ( "Can't get proc address: glBindVertexArrayOES" );

glDeleteVertexArraysOES = (PFNGLDELETEVERTEXARRAYSOESPROC)eglGetProcAddress ( "glDeleteVertexArraysOES" );
if ( !glDeleteVertexArraysOES )
LOG ( "Can't get proc address: glDeleteVertexArraysOES" );

glGenVertexArraysOES = (PFNGLGENVERTEXARRAYSOESPROC)eglGetProcAddress ( "glGenVertexArraysOES" );
if ( glGenVertexArraysOES )
LOG ( "Can't get proc address: glGenVertexArraysOES" );
}
else
{
LOG ( vao << " not supported" );
}

当然我得到了日志消息
Can't get proc address: glGenVertexArraysOES

My Android.mk (shortened a little bit):

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE := smart
LOCAL_SRC_FILES := Base/Node.cpp
...

LOCAL_LDLIBS := -llog -landroid -lGLESv2 -lEGL
LOCAL_STATIC_LIBRARIES := nv_and_util

include $(BUILD_SHARED_LIBRARY)

$(call import-add-path, C:/NVPACK/TDK_Samples/tegra_android_native_samples_v10p00/libs/jni)
$(call import-module,nv_and_util)

设备型号三星 i9003 与 Android 2.3.5

最佳答案

我刚刚测试了这个......

代替:

#include <GLES2/gl2ext.h>

有了这个:
#define GL_GLEXT_PROTOTYPES
#include <GLES2/gl2ext.h>

宏 GL_GLEXT_PROTOTYPES 必须在包含 gl2ext.h 之前定义。
无需明确定义函数。

关于android-ndk,找不到 glGenVertexArraysOES,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12490567/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com