Git Product home page Git Product logo

Comments (6)

alculquicondor avatar alculquicondor commented on May 8, 2024

I have the following line in my main Android.mk file:

LOCAL_LDLIBS += -ldl -lEGL -lGLESv3 -llog -lz -landroid \
  -lgvr

However, the debugger shows this:
screenshot_2017-09-18_10-10-04

I also tried adding -lGLESv3 to Android.mk files for fplbase (on FPLBASE_COMMON_LDLIBS) but the debugger still shows the same.

from fplbase.

aardappel avatar aardappel commented on May 8, 2024

On your API target, those functions should be natively available, i.e we do:

#if __ANDROID_API__ >= 18
#include <GLES3/gl3.h>
#else  // __ANDROID_API__ < 18
#include <GLES2/gl2.h>
#include "gl3stub.h"
#endif  // __ANDROID_API__ < 18

Only the stubs should declare them as variables that can be NULL. The init (which shouldn't run on your machine) is here:

void AndroidInitGl3Functions() {
#if __ANDROID_API__ < 18
    gl3stubInit();
#endif
}

Can you check if gl3stubInit() runs? if so, there may be something wrong with your target settings?

from fplbase.

alculquicondor avatar alculquicondor commented on May 8, 2024

It doesn't run, i.e. I checked the __ANDROID_API__ variable and it is correctly set to 24. I also tried calling gl3stubInit from my application code. It returns GL_TRUE, but the segmentation fault persists.

from fplbase.

alculquicondor avatar alculquicondor commented on May 8, 2024

Given your idea, I fixed it by removing $(NDK_ROOT)/sources/android/ndk-helper/gl3stub.c from FPLBASE_COMMON_SRC_FILES. I also have -lGLESv3 in my project's Android.mk, but that might be irrelevant. After that, the debugger no longer shows NULL for glGenVertexArrays. Although, it shows a link to libGLESv2.so for this function. But that's probably fine.

I could set a PR with this fix, but I'm not sure how to check for APP_PLATFORM < 18 (or something like that) to conditionally add gl3stub.c as source in fplbase's Android.mk.

from fplbase.

aardappel avatar aardappel commented on May 8, 2024

Wow, I guess this is really a linker problem then? It sees two definitions of the function, and somehow decides to make it point to the uninitialized one from gl3stub.c.

Which is weird, because I'd think they'd look like different kind of symbols to the linker, given that one is not necessarily a function pointer variable.

Anyway, as to how to fix this.. @stewartmiles, do you know how to make this conditional?

from fplbase.

stewartmiles avatar stewartmiles commented on May 8, 2024

I think the easiest way to conditionally compile $(NDK_ROOT)/sources/android/ndk_helper/gl3stub.c is to add a fplbase file that includes a new file e.g fplbase/src/gl3stub_android.c and have that file switch between either compiling to nothing or including ndk_helper's stub implementation. You'll need to add $(NDK_ROOT)/sources/android to the include path when building fplbase.

In fplbase/src/gl3stub_android.c something like this:

#if defined(__ANDROID__)
#if defined(__ANDROID__API__) >= 18
#include "ndk_helper/gl3stub.c"
#endif  // defined(__ANDROID__API__) >= 18
#endif  // defined(__ANDROID__)

from fplbase.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.