cocos2dx 屏幕大小

cocos2dx 屏幕大小,第1张

概述1、java端 //mScreenWidth mScreenHeight 屏幕的宽和高@Override public void onSurfaceCreated(final GL10 pGL10, final EGLConfig pEGLConfig) { Cocos2dxRenderer.nativeInit(this.mScreenWidth, this.mScreenHeight)

1、java端

//mScreenWIDth mScreenHeight 屏幕的宽和高@OverrIDe	public voID onSurfaceCreated(final GL10 pGL10,final EGLConfig pEGLConfig) {		Cocos2dxRenderer.nativeInit(this.mScreenWIDth,this.mScreenHeight);		this.mLastTickInNanoSeconds = System.nanoTime();	}

2、C++端(proj.androID/jni/main.cpp):

voID Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeInit(jnienv*  env,jobject thiz,jint w,jint h){    if (!CCDirector::sharedDirector()->getopenGLVIEw())    {        CCEGLVIEw *vIEw = CCEGLVIEw::sharedOpenGLVIEw();        vIEw->setFrameSize(w,h); //设置屏幕大小        AppDelegate *pAppDelegate = new AppDelegate();        CCApplication::sharedApplication()->run();    }    else    {        ccGlinvalIDateStateCache();        CCshadercache::sharedshadercache()->reloadDefaultShaders();        ccDrawInit();        CCTextureCache::reloadAllTextures();        CCNotificationCenter::sharednotificationCenter()->postNotification(EVENT_COME_TO_FOREGROUND,NulL);        CCDirector::sharedDirector()->setGLDefaultValues();     }}
总结

以上是内存溢出为你收集整理的cocos2dx 屏幕大小全部内容,希望文章能够帮你解决cocos2dx 屏幕大小所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/web/1051398.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-25
下一篇2022-05-25

发表评论

登录后才能评论

评论列表(0条)

    保存