mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 22:02:49 -06:00
.examples improved Android builder example
git-svn-id: svn://ultimatepp.org/upp/trunk@8659 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
a33bb135de
commit
4387f25403
7 changed files with 150 additions and 80 deletions
|
|
@ -30,6 +30,17 @@ JNIEXPORT void JNICALL Java_org_upp_AndroidMath_Vector_construct
|
|||
mm.Insert(env, obj, Vector(size));
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: org_upp_AndroidMath_Vector
|
||||
* Method: copyConstruct
|
||||
* Signature: (Lorg/upp/AndroidMath/Vector;)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_org_upp_AndroidMath_Vector_copyConstruct
|
||||
(JNIEnv *env, jobject objSrc, jobject objDst)
|
||||
{
|
||||
mm.MakeCopy(env, objSrc, objDst);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: org_upp_AndroidMath_Vector
|
||||
* Method: destruct
|
||||
|
|
@ -60,9 +71,11 @@ JNIEXPORT jint JNICALL Java_org_upp_AndroidMath_Vector_getSize
|
|||
* Signature: (I)F
|
||||
*/
|
||||
JNIEXPORT jfloat JNICALL Java_org_upp_AndroidMath_Vector_get
|
||||
(JNIEnv *, jobject, jint)
|
||||
(JNIEnv *env, jobject obj, jint id)
|
||||
{
|
||||
return 0.0f;
|
||||
Vector* vec = mm.Get(env, obj);
|
||||
|
||||
return vec->Get(id);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -71,9 +84,22 @@ JNIEXPORT jfloat JNICALL Java_org_upp_AndroidMath_Vector_get
|
|||
* Signature: (IF)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_org_upp_AndroidMath_Vector_set
|
||||
(JNIEnv *, jobject, jint, jfloat)
|
||||
(JNIEnv *env, jobject obj, jint id, jfloat value)
|
||||
{
|
||||
|
||||
Vector* vec = mm.Get(env, obj);
|
||||
vec->Set(id, value);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: org_upp_AndroidMath_Vector
|
||||
* Method: multipleByScalar
|
||||
* Signature: (F)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_org_upp_AndroidMath_Vector_multipleByScalar
|
||||
(JNIEnv *env, jobject obj, jfloat scalar)
|
||||
{
|
||||
Vector* vec = mm.Get(env, obj);
|
||||
vec->MultipleByScalar(scalar);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -86,7 +112,7 @@ JNIEXPORT jstring JNICALL Java_org_upp_AndroidMath_Vector_toString
|
|||
{
|
||||
Vector* vec = mm.Get(env, obj);
|
||||
|
||||
return env->NewStringUTF(vec->ToString().c_str());
|
||||
return env->NewStringUTF((vec->ToString()).c_str());
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue