in general, it works fine. but if I lock the screen and wait for APP_CMD_LOST_FOCUS, then I unlock srceen. he changes to a portrait! but I find that egl buff is still set to landscape, and all coordinates are larger.
my installation of AndroidManifest.xml:
<activity android:name="android.app.NativeActivity" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:configChanges="orientation|keyboardHidden" android:screenOrientation="landscape" android:clearTaskOnLaunch="true"> <meta-data android:name="android.app.lib_name" android:value="sunred" /> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity>
my egl init C ++ code
int engine_init_display(OSCONTEXTENGINE* pEngine, const DISPLAY_CONFIG* pConfig) {
when APP_CMD_INIT_WINDOW happens, I call engine_init_display.
Is there any way to get it to use C ++ in landscape mode?
rendering frame:
works fine:
pEngine->m_iWidth = 960; pEngine->m_iHeight = 540;
lock screeen → APP_CMD_LOST_FOCUS → unlock screen
pEngine->m_iWidth = 540; pEngine->m_iHeight = 960;
windows change to a portrait! but egl buff is still set up for the landscape, and all coordinates are larger.
source share