Comments (9)
No idea, but it is not related in any way to raylib, sorry. This is not the best place for questions and discussions, it is for issues with raylib-go.
from raylib-go.
Why even try to use something like purego on Android, how is it going to find the library there? Does it even support Android? You anyway need C for shared library so why not just use C?
from raylib-go.
I just looked at this, and still am not sure what you are trying to do here. JNI is used to access Java from C, of C from Java, you don't even have Java here. You just should use C, i.e. include headers you need, call what you want, and link with that library. How is JNI even related to this?
from raylib-go.
well, sometime I need jni to call something extra ...,
I was able to run my OpenCL purego wrapper on termux(android enviroment), so I would like to try in apk ...
So my question is whether is android_app *GetAndroidApp();
available outside internal library
from raylib-go.
You can see for yourself that it is not exposed.
So how is your example related to JNI then? I still don't understand why you even go with all that trouble with purego, just use cgo, link the library, and put the library in android/libs, what do jni and purego have to do with that? There is nothing to gain here, you must use C anyway.
from raylib-go.
so, purego is primary to avoid cgo, but it is also good to avoid complicate link with headers ..., so if I (in my wrapper) create var somename func(...); porego.RegisterFunc(handle, "...", &somename)
I do not have to write other version for cgo version, it will work even in cgo (yes, if you have cgo which has good link, it is useless, because cgo is litle bit faster, but if c headers in f.e. in android is coplicate purego still can be usefull)
from raylib-go.
But you cannot avoid cgo if you want to compile library as c-shared
. You must use it on Android no matter what else you are doing, so how do you avoid cgo?
from raylib-go.
In my experience, purego and cgo have exactly the same performance (i.e. I use it for some image decoders). And if I already must use cgo, I just really don't see a point to use experimental library that doesn't even work if function receives or returns a plain struct.
from raylib-go.
well, I was found
raylib-go/raylib/utils_android.go
Line 37 in c3665eb
I am NOT trying avoid cgo in android, compile headers to android in Go is hard, so I was try use purego as "cheap wrapper" with many options of paths (androids are very variable with path shared lib) as I have in https://github.com/opencl-pure/pureCL/blob/9bd3c662ac677f6f25beb12282d1e267b5babade/purego_library_unix.go#L25
similar to https://github.com/krrishnarraj/libopencl-stub/blob/4a235674884fcb75886142dd4ce2f9aa08117037/src/libopencl.c#L82 ...
as I notice android libOpenCL.so is not public ..., so I was try copy to internal lib ...
from raylib-go.
Related Issues (20)
- WASM HOT 1
- Building for Android arm64 HOT 2
- Intermittent SIGBUS: bus error When uploading a custom mesh to gpu HOT 1
- log android HOT 2
- cannot locate symbol "internal_storage_path" HOT 12
- Dear IMGUI support HOT 1
- 2 or 3 second build times? HOT 2
- Misleading use of color type RGBA. HOT 2
- No function for `GuiLoadIcons` HOT 1
- Cross compiling error HOT 6
- Can't debug via go-delve on M1 MacOS. (missing rodata struct member) HOT 1
- Issues with using DLL on Windows HOT 1
- Adding `SwapScreenBuffer()` and `PollInputEvents()` functions HOT 3
- Can not build for windows/darwin HOT 2
- errors with camera on fedora HOT 3
- Unable to remove status bar from raygui Panels HOT 11
- Not support win7? Is there any way to work with win7? HOT 3
- delve fails to build, can't find utils_log.h HOT 9
- strange errors HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from raylib-go.