• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ JNI_ENV函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中JNI_ENV函数的典型用法代码示例。如果您正苦于以下问题:C++ JNI_ENV函数的具体用法?C++ JNI_ENV怎么用?C++ JNI_ENV使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了JNI_ENV函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: JNI_ENV

void JNICallbackAdapter::onError(THREAD_CONTEXT threadContext, long errorCode, std::string error)
{
	controller->log(threadContext, 0, "Libaio event generated errors, callback object was informed about it");

	jstring strError = JNI_ENV(threadContext)->NewStringUTF(error.data());

	JNI_ENV(threadContext)->CallVoidMethod(fileController, controller->error, callback, sequence, isRead ? nullObj : bufferReference, (jint)errorCode, strError);

	release(threadContext);
}
开发者ID:AddictedCS,项目名称:hornetq,代码行数:10,代码来源:JNICallbackAdapter.cpp


示例2: Java_org_andengine_extension_scripting_Test_test

JNIEXPORT jobject JNICALL Java_org_andengine_extension_scripting_Test_test(JNIEnv* pJNIEnv, jclass pJClass) {
	Engine* engine = getEngine();
	Context* context = getContext();
	AssetManager* assetManager = context->getAssetManager();

	/* Fetch managers. */
	TextureManager* textureManager = engine->getTextureManager();
	VertexBufferObjectManager* vertexBufferObjectManager = engine->getVertexBufferObjectManager();

	/* Create texture. */
	AssetBitmapTexture texture(textureManager, assetManager, JNI_ENV()->NewStringUTF("gfx/box.png")); //, BitmapTextureFormat::RGBA_4444);
	texture.load();

	/* Extract TextureRegion. */
	TextureRegion textureRegion(&texture, 0, 0, texture.getWidth(), texture.getHeight());

	/* Create an Entity/Sprite. */
	int size = 100;
	Entity* entity = new Sprite(360 - (size / 2), 240 - (size / 2), size, size, &textureRegion, vertexBufferObjectManager);
//	Entity* entity = new Rectangle(360 - (size / 2), 240 - (size / 2), size, size, vertexBufferObjectManager);

	entity->setRotation(45);
	entity->setScale(2);

	/* Release managers. */
	delete vertexBufferObjectManager;
	delete textureManager;

	return entity->unwrap();
}
开发者ID:ReactionYkt,项目名称:AndroidGames,代码行数:30,代码来源:Test.cpp


示例3: Java_org_andengine_extension_scripting_opengl_vbo_DrawTypeProxy_nativeInitClass

JNIEXPORT void JNICALL Java_org_andengine_extension_scripting_opengl_vbo_DrawTypeProxy_nativeInitClass(JNIEnv* pJNIEnv, jclass pJClass) {
	sDrawTypeClass = (jclass)JNI_ENV()->NewGlobalRef(JNI_ENV()->FindClass("org/andengine/opengl/vbo/DrawType"));
	jfieldID DrawType_STATIC_ID = JNI_ENV()->GetStaticFieldID(sDrawTypeClass, "STATIC", "Lorg/andengine/opengl/vbo/DrawType;");
	DrawType::STATIC = new DrawType(JNI_ENV()->GetStaticObjectField(sDrawTypeClass, DrawType_STATIC_ID));
	jfieldID DrawType_DYNAMIC_ID = JNI_ENV()->GetStaticFieldID(sDrawTypeClass, "DYNAMIC", "Lorg/andengine/opengl/vbo/DrawType;");
	DrawType::DYNAMIC = new DrawType(JNI_ENV()->GetStaticObjectField(sDrawTypeClass, DrawType_DYNAMIC_ID));
	jfieldID DrawType_STREAM_ID = JNI_ENV()->GetStaticFieldID(sDrawTypeClass, "STREAM", "Lorg/andengine/opengl/vbo/DrawType;");
	DrawType::STREAM = new DrawType(JNI_ENV()->GetStaticObjectField(sDrawTypeClass, DrawType_STREAM_ID));
}
开发者ID:Slaught3r,项目名称:FirstGame,代码行数:9,代码来源:DrawType.cpp


示例4: Java_org_andengine_extension_scripting_engine_camera_CameraProxy_nativeInitClass

JNIEXPORT void JNICALL Java_org_andengine_extension_scripting_engine_camera_CameraProxy_nativeInitClass(JNIEnv* pJNIEnv, jclass pJClass) {
	sCameraClass = (jclass)JNI_ENV()->NewGlobalRef(pJClass);
	sConstructor__FFFF = JNI_ENV()->GetMethodID(sCameraClass, "<init>", "(JFFFF)V");
	sMethod__GetWidth = JNI_ENV()->GetMethodID(sCameraClass, "getWidth", "()F");
	sMethod__GetHeight = JNI_ENV()->GetMethodID(sCameraClass, "getHeight", "()F");
	sMethod__GetRotation = JNI_ENV()->GetMethodID(sCameraClass, "getRotation", "()F");
	sMethod__SetRotation__F = JNI_ENV()->GetMethodID(sCameraClass, "setRotation", "(F)V");
}
开发者ID:ReactionYkt,项目名称:AndroidGames,代码行数:8,代码来源:Camera.cpp


示例5: JNI_ENV

CameraScene::CameraScene(Camera* pCamera) {
	this->mUnwrapped = JNI_ENV()->NewObject(sCameraSceneClass, sConstructor____org_andengine_engine_camera_Camera__, (jlong)this, pCamera->unwrap());
}
开发者ID:Slaught3r,项目名称:FirstGame,代码行数:3,代码来源:CameraScene.cpp


示例6: Entity

IEntity* CameraScene::getChild(jint pIndex) {
	return new Entity(JNI_ENV()->CallObjectMethod(this->mUnwrapped, sMethod__GetChild__I, pIndex));
}
开发者ID:Slaught3r,项目名称:FirstGame,代码行数:3,代码来源:CameraScene.cpp


示例7: Java_org_andengine_extension_scripting_entity_scene_CameraSceneProxy_nativeInitClass

JNIEXPORT void JNICALL Java_org_andengine_extension_scripting_entity_scene_CameraSceneProxy_nativeInitClass(JNIEnv* pJNIEnv, jclass pJClass) {
	sCameraSceneClass = (jclass)JNI_ENV()->NewGlobalRef(pJClass);
	sConstructor____org_andengine_engine_camera_Camera__ = JNI_ENV()->GetMethodID(sCameraSceneClass, "<init>", "(JLorg/andengine/engine/camera/Camera;)V");
	sConstructor = JNI_ENV()->GetMethodID(sCameraSceneClass, "<init>", "(J)V");
	sMethod__GetY = JNI_ENV()->GetMethodID(sCameraSceneClass, "getY", "()F");
	sMethod__GetX = JNI_ENV()->GetMethodID(sCameraSceneClass, "getX", "()F");
	sMethod__SetColor__FFF = JNI_ENV()->GetMethodID(sCameraSceneClass, "setColor", "(FFF)V");
	sMethod__SetColor____org_andengine_util_color_Color__ = JNI_ENV()->GetMethodID(sCameraSceneClass, "setColor", "(Lorg/andengine/util/color/Color;)V");
	sMethod__SetColor__FFFF = JNI_ENV()->GetMethodID(sCameraSceneClass, "setColor", "(FFFF)V");
	sMethod__SetScale__FF = JNI_ENV()->GetMethodID(sCameraSceneClass, "setScale", "(FF)V");
	sMethod__SetScale__F = JNI_ENV()->GetMethodID(sCameraSceneClass, "setScale", "(F)V");
	sMethod__GetRotation = JNI_ENV()->GetMethodID(sCameraSceneClass, "getRotation", "()F");
	sMethod__SetRotation__F = JNI_ENV()->GetMethodID(sCameraSceneClass, "setRotation", "(F)V");
	sMethod__AttachChild____org_andengine_entity_IEntity__ = JNI_ENV()->GetMethodID(sCameraSceneClass, "attachChild", "(Lorg/andengine/entity/IEntity;)V");
	sMethod__AttachChild____org_andengine_entity_IEntity__I = JNI_ENV()->GetMethodID(sCameraSceneClass, "attachChild", "(Lorg/andengine/entity/IEntity;I)Z");
	sMethod__SetX__F = JNI_ENV()->GetMethodID(sCameraSceneClass, "setX", "(F)V");
	sMethod__SetY__F = JNI_ENV()->GetMethodID(sCameraSceneClass, "setY", "(F)V");
	sMethod__GetScaleX = JNI_ENV()->GetMethodID(sCameraSceneClass, "getScaleX", "()F");
	sMethod__GetScaleY = JNI_ENV()->GetMethodID(sCameraSceneClass, "getScaleY", "()F");
	sMethod__GetSkewX = JNI_ENV()->GetMethodID(sCameraSceneClass, "getSkewX", "()F");
	sMethod__GetSkewY = JNI_ENV()->GetMethodID(sCameraSceneClass, "getSkewY", "()F");
	sMethod__SetSkew__FF = JNI_ENV()->GetMethodID(sCameraSceneClass, "setSkew", "(FF)V");
	sMethod__SetSkew__F = JNI_ENV()->GetMethodID(sCameraSceneClass, "setSkew", "(F)V");
	sMethod__GetRed = JNI_ENV()->GetMethodID(sCameraSceneClass, "getRed", "()F");
	sMethod__GetGreen = JNI_ENV()->GetMethodID(sCameraSceneClass, "getGreen", "()F");
	sMethod__GetBlue = JNI_ENV()->GetMethodID(sCameraSceneClass, "getBlue", "()F");
	sMethod__GetAlpha = JNI_ENV()->GetMethodID(sCameraSceneClass, "getAlpha", "()F");
	sMethod__GetColor = JNI_ENV()->GetMethodID(sCameraSceneClass, "getColor", "()Lorg/andengine/util/color/Color;");
	sMethod__SetRed__F = JNI_ENV()->GetMethodID(sCameraSceneClass, "setRed", "(F)V");
	sMethod__SetGreen__F = JNI_ENV()->GetMethodID(sCameraSceneClass, "setGreen", "(F)V");
	sMethod__SetBlue__F = JNI_ENV()->GetMethodID(sCameraSceneClass, "setBlue", "(F)V");
	sMethod__SetAlpha__F = JNI_ENV()->GetMethodID(sCameraSceneClass, "setAlpha", "(F)V");
	sMethod__GetChildCount = JNI_ENV()->GetMethodID(sCameraSceneClass, "getChildCount", "()I");
	sMethod__GetChild__I = JNI_ENV()->GetMethodID(sCameraSceneClass, "getChild", "(I)Lorg/andengine/entity/IEntity;");
	sMethod__GetChild____org_andengine_entity_IEntityMatcher__ = JNI_ENV()->GetMethodID(sCameraSceneClass, "getChild", "(Lorg/andengine/entity/IEntityMatcher;)Lorg/andengine/entity/IEntity;");
	sMethod__DetachSelf = JNI_ENV()->GetMethodID(sCameraSceneClass, "detachSelf", "()Z");
	sMethod__DetachChild____org_andengine_entity_IEntityMatcher__ = JNI_ENV()->GetMethodID(sCameraSceneClass, "detachChild", "(Lorg/andengine/entity/IEntityMatcher;)Lorg/andengine/entity/IEntity;");
	sMethod__DetachChild____org_andengine_entity_IEntity__ = JNI_ENV()->GetMethodID(sCameraSceneClass, "detachChild", "(Lorg/andengine/entity/IEntity;)Z");
	sMethod__SwapChildren__II = JNI_ENV()->GetMethodID(sCameraSceneClass, "swapChildren", "(II)Z");
	sMethod__SwapChildren____org_andengine_entity_IEntity____org_andengine_entity_IEntity__ = JNI_ENV()->GetMethodID(sCameraSceneClass, "swapChildren", "(Lorg/andengine/entity/IEntity;Lorg/andengine/entity/IEntity;)Z");
}
开发者ID:Slaught3r,项目名称:FirstGame,代码行数:41,代码来源:CameraScene.cpp


示例8: Color

Color* CameraScene::getColor() {
	return new Color(JNI_ENV()->CallObjectMethod(this->mUnwrapped, sMethod__GetColor));
}
开发者ID:Slaught3r,项目名称:FirstGame,代码行数:3,代码来源:CameraScene.cpp



注:本文中的JNI_ENV函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ JNU_GetEnv函数代码示例发布时间:2022-05-30
下一篇:
C++ JNI_CreateJavaVM函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap