-
Notifications
You must be signed in to change notification settings - Fork 7
new example native activity #48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
extern "C" { | ||
|
||
void call_souce_process(android_app *state, android_poll_source *s) { | ||
s->process(state, s); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can not call c++ member function from zig.
|
||
const float* get_acceleration(const ASensorEvent *event) | ||
{ | ||
return &event->acceleration.x; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can not use anonymous union ?
typedef struct ASensorEvent {
int32_t version; /* sizeof(struct ASensorEvent) */
int32_t sensor;
int32_t type;
int32_t reserved0;
int64_t timestamp;
union {
float data[16];
ASensorVector vector;
ASensorVector acceleration;
ASensorVector magnetic;
float temperature;
float distance;
float light;
float pressure;
};
int32_t reserved1[4];
} ASensorEvent;
@@ -0,0 +1,10 @@ | |||
pub usingnamespace @cImport({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should avoid pub usingnamespace
as it's proposed to be removed for legitimate reasons.
CTranslateModule should be using for this kind of thing instead.
Related issue:
ziglang/zig#20663
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see 👀
This is not an example I'm willing to merge in and/or maintain. The value of this is unclear. |
I tried a simple example using android_main.
I want to use vulkan and openxr on android with zig.
Thank you.