Skip to content

Commit

Permalink
Fix JNI signature for RenderTarget API.
Browse files Browse the repository at this point in the history
  • Loading branch information
prideout committed Feb 21, 2020
1 parent 3a9d4c7 commit f403876
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 10 deletions.
24 changes: 19 additions & 5 deletions android/filament-android/src/main/cpp/RenderTarget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,30 +39,30 @@ Java_com_google_android_filament_RenderTarget_nDestroyBuilder(JNIEnv *env, jclas

extern "C" JNIEXPORT void JNICALL
Java_com_google_android_filament_RenderTarget_nBuilderTexture(JNIEnv *env, jclass type,
jlong nativeBuilder, jlong attachment, jlong nativeTexture) {
jlong nativeBuilder, jint attachment, jlong nativeTexture) {
RenderTarget::Builder* builder = (RenderTarget::Builder*) nativeBuilder;
Texture* texture = (Texture*) nativeTexture;
builder->texture(RenderTarget::AttachmentPoint(attachment), texture);
}

extern "C" JNIEXPORT void JNICALL
Java_com_google_android_filament_RenderTarget_nBuilderMipLevel(JNIEnv *env, jclass type,
jlong nativeBuilder, jlong attachment, jint level) {
jlong nativeBuilder, jint attachment, jint level) {
RenderTarget::Builder* builder = (RenderTarget::Builder*) nativeBuilder;
builder->mipLevel(RenderTarget::AttachmentPoint(attachment), level);
}

extern "C" JNIEXPORT void JNICALL
Java_com_google_android_filament_RenderTarget_nBuilderFace(JNIEnv *env, jclass type,
jlong nativeBuilder, jlong attachment, jint face) {
jlong nativeBuilder, jint attachment, jint face) {
RenderTarget::Builder* builder = (RenderTarget::Builder*) nativeBuilder;
RenderTarget::CubemapFace cubeface = (RenderTarget::CubemapFace) face;
builder->face(RenderTarget::AttachmentPoint(attachment), cubeface);
}

extern "C" JNIEXPORT void JNICALL
Java_com_google_android_filament_RenderTarget_nBuilderLayer(JNIEnv *env, jclass type,
jlong nativeBuilder, jlong attachment, jint layer) {
jlong nativeBuilder, jint attachment, jint layer) {
RenderTarget::Builder* builder = (RenderTarget::Builder*) nativeBuilder;
builder->layer(RenderTarget::AttachmentPoint(attachment), layer);
}
Expand All @@ -77,7 +77,21 @@ Java_com_google_android_filament_RenderTarget_nBuilderBuild(JNIEnv *env, jclass

extern "C" JNIEXPORT jint JNICALL
Java_com_google_android_filament_RenderTarget_nGetMipLevel(JNIEnv *env, jclass type,
jlong nativeTarget, jlong attachment) {
jlong nativeTarget, jint attachment) {
RenderTarget* target = (RenderTarget*) nativeTarget;
return (jint) target->getMipLevel(RenderTarget::AttachmentPoint(attachment));
}

extern "C" JNIEXPORT jint JNICALL
Java_com_google_android_filament_RenderTarget_nGetFace(JNIEnv *env, jclass type,
long nativeTarget, int attachment) {
RenderTarget* target = (RenderTarget*) nativeTarget;
return (jint) target->getFace(RenderTarget::AttachmentPoint(attachment));
}

extern "C" JNIEXPORT jint JNICALL
Java_com_google_android_filament_RenderTarget_nGetLayer(JNIEnv *env, jclass type,
long nativeTarget, int attachment) {
RenderTarget* target = (RenderTarget*) nativeTarget;
return (jint) target->getLayer(RenderTarget::AttachmentPoint(attachment));
}
Original file line number Diff line number Diff line change
Expand Up @@ -206,11 +206,11 @@ void clearNativeObject() {
}

private static native long nCreateBuilder();
private static native long nDestroyBuilder(long nativeBuilder);
private static native long nBuilderTexture(long nativeBuilder, int attachment, long nativeTexture);
private static native long nBuilderMipLevel(long nativeBuilder, int attachment, int level);
private static native long nBuilderFace(long nativeBuilder, int attachment, int face);
private static native long nBuilderLayer(long nativeBuilder, int attachment, int layer);
private static native void nDestroyBuilder(long nativeBuilder);
private static native void nBuilderTexture(long nativeBuilder, int attachment, long nativeTexture);
private static native void nBuilderMipLevel(long nativeBuilder, int attachment, int level);
private static native void nBuilderFace(long nativeBuilder, int attachment, int face);
private static native void nBuilderLayer(long nativeBuilder, int attachment, int layer);
private static native long nBuilderBuild(long nativeBuilder, long nativeEngine);

private static native int nGetMipLevel(long nativeRenderTarget, int attachment);
Expand Down

0 comments on commit f403876

Please sign in to comment.