mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 11:48:52 +02:00
Set HomeActivity transparent to avoid texture corruption (black and white)
This commit is contained in:
parent
97a493d113
commit
306b8cc68a
7 changed files with 27 additions and 49 deletions
|
@ -42,7 +42,7 @@
|
||||||
android:name=".HomeActivity"
|
android:name=".HomeActivity"
|
||||||
android:label="@string/home"
|
android:label="@string/home"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/AppTheme.NoActionBar">
|
android:theme="@style/Theme.AppCompat.Translucent.NoActionBar">
|
||||||
</activity>
|
</activity>
|
||||||
<activity
|
<activity
|
||||||
android:name=".GotoActivity"
|
android:name=".GotoActivity"
|
||||||
|
|
|
@ -36,8 +36,6 @@ public class InterfaceActivity extends QtActivity {
|
||||||
|
|
||||||
//public static native void handleHifiURL(String hifiURLString);
|
//public static native void handleHifiURL(String hifiURLString);
|
||||||
private native long nativeOnCreate(InterfaceActivity instance, AssetManager assetManager);
|
private native long nativeOnCreate(InterfaceActivity instance, AssetManager assetManager);
|
||||||
//private native void nativeOnPause();
|
|
||||||
//private native void nativeOnResume();
|
|
||||||
private native void nativeOnDestroy();
|
private native void nativeOnDestroy();
|
||||||
private native void nativeGotoUrl(String url);
|
private native void nativeGotoUrl(String url);
|
||||||
private native void nativeGoBackFromAndroidActivity();
|
private native void nativeGoBackFromAndroidActivity();
|
||||||
|
@ -120,29 +118,26 @@ public class InterfaceActivity extends QtActivity {
|
||||||
@Override
|
@Override
|
||||||
protected void onPause() {
|
protected void onPause() {
|
||||||
super.onPause();
|
super.onPause();
|
||||||
//nativeOnPause();
|
nativeEnterBackground();
|
||||||
//gvrApi.pauseTracking();
|
//gvrApi.pauseTracking();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onStart() {
|
protected void onStart() {
|
||||||
super.onStart();
|
super.onStart();
|
||||||
if (!isLoading) {
|
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
|
||||||
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
|
|
||||||
}
|
|
||||||
nativeEnterForeground();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onStop() {
|
protected void onStop() {
|
||||||
super.onStop();
|
super.onStop();
|
||||||
nativeEnterBackground();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
//nativeOnResume();
|
nativeEnterForeground();
|
||||||
//gvrApi.resumeTracking();
|
//gvrApi.resumeTracking();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,10 +27,7 @@ public class SplashActivity extends Activity {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onAppLoadedComplete() {
|
public void onAppLoadedComplete() {
|
||||||
// Give interface more time so textures don't fail(got deleted) on Adreno (joystick)
|
startActivity(new Intent(this, HomeActivity.class)); // + 2 sec
|
||||||
new Handler(getMainLooper()).postDelayed(() -> {
|
SplashActivity.this.finish();
|
||||||
startActivity(new Intent(this, HomeActivity.class));
|
|
||||||
new Handler(getMainLooper()).postDelayed(() -> SplashActivity.this.finish(), 1000);
|
|
||||||
}, 500);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
android:id="@+id/toolbar"
|
android:id="@+id/toolbar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="?attr/actionBarSize"
|
android:layout_height="?attr/actionBarSize"
|
||||||
android:background="?attr/colorPrimaryDark"
|
android:background="@color/colorPrimaryDark"
|
||||||
android:elevation="4dp"
|
android:elevation="4dp"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
@ -33,6 +33,7 @@
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_gravity="start"
|
android:layout_gravity="start"
|
||||||
android:fitsSystemWindows="true"
|
android:fitsSystemWindows="true"
|
||||||
|
android:background="@color/colorPrimaryDark"
|
||||||
app:menu="@menu/menu_home"
|
app:menu="@menu/menu_home"
|
||||||
>
|
>
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
||||||
|
android:background="@color/colorPrimary"
|
||||||
tools:context="io.highfidelity.hifiinterface.HomeActivity"
|
tools:context="io.highfidelity.hifiinterface.HomeActivity"
|
||||||
tools:showIn="@layout/activity_home">
|
tools:showIn="@layout/activity_home">
|
||||||
|
|
||||||
|
|
|
@ -8192,15 +8192,11 @@ void Application::openAndroidActivity(const QString& activityName) {
|
||||||
void Application::enterBackground() {
|
void Application::enterBackground() {
|
||||||
QMetaObject::invokeMethod(DependencyManager::get<AudioClient>().data(),
|
QMetaObject::invokeMethod(DependencyManager::get<AudioClient>().data(),
|
||||||
"stop", Qt::BlockingQueuedConnection);
|
"stop", Qt::BlockingQueuedConnection);
|
||||||
getActiveDisplayPlugin()->deactivate();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::enterForeground() {
|
void Application::enterForeground() {
|
||||||
QMetaObject::invokeMethod(DependencyManager::get<AudioClient>().data(),
|
QMetaObject::invokeMethod(DependencyManager::get<AudioClient>().data(),
|
||||||
"start", Qt::BlockingQueuedConnection);
|
"start", Qt::BlockingQueuedConnection);
|
||||||
if (!getActiveDisplayPlugin() || !getActiveDisplayPlugin()->activate()) {
|
|
||||||
qWarning() << "Could not re-activate display plugin";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -131,44 +131,32 @@ void Basic2DWindowOpenGLDisplayPlugin::compositeExtra() {
|
||||||
// render stick base
|
// render stick base
|
||||||
auto stickBaseTransform = DependencyManager::get<CompositorHelper>()->getPoint2DTransform(virtualPadManager.getLeftVirtualPad()->getFirstTouch(),
|
auto stickBaseTransform = DependencyManager::get<CompositorHelper>()->getPoint2DTransform(virtualPadManager.getLeftVirtualPad()->getFirstTouch(),
|
||||||
_virtualPadPixelSize, _virtualPadPixelSize);
|
_virtualPadPixelSize, _virtualPadPixelSize);
|
||||||
render([&](gpu::Batch& batch) {
|
|
||||||
batch.enableStereo(false);
|
|
||||||
batch.setProjectionTransform(mat4());
|
|
||||||
batch.setPipeline(_cursorPipeline);
|
|
||||||
batch.setResourceTexture(0, _virtualPadStickBaseTexture);
|
|
||||||
batch.resetViewTransform();
|
|
||||||
batch.setModelTransform(stickBaseTransform);
|
|
||||||
batch.setViewportTransform(ivec4(uvec2(0), getRecommendedRenderSize()));
|
|
||||||
batch.draw(gpu::TRIANGLE_STRIP, 4);
|
|
||||||
});
|
|
||||||
// render stick head
|
|
||||||
auto stickTransform = DependencyManager::get<CompositorHelper>()->getPoint2DTransform(virtualPadManager.getLeftVirtualPad()->getCurrentTouch(),
|
auto stickTransform = DependencyManager::get<CompositorHelper>()->getPoint2DTransform(virtualPadManager.getLeftVirtualPad()->getCurrentTouch(),
|
||||||
_virtualPadPixelSize, _virtualPadPixelSize);
|
_virtualPadPixelSize, _virtualPadPixelSize);
|
||||||
|
auto jumpTransform = DependencyManager::get<CompositorHelper>()->getPoint2DTransform(virtualPadManager.getJumpButtonPosition(),
|
||||||
|
_virtualPadJumpBtnPixelSize, _virtualPadJumpBtnPixelSize);
|
||||||
|
|
||||||
render([&](gpu::Batch& batch) {
|
render([&](gpu::Batch& batch) {
|
||||||
batch.enableStereo(false);
|
batch.enableStereo(false);
|
||||||
|
batch.setFramebuffer(_compositeFramebuffer);
|
||||||
|
batch.resetViewTransform();
|
||||||
batch.setProjectionTransform(mat4());
|
batch.setProjectionTransform(mat4());
|
||||||
batch.setPipeline(_cursorPipeline);
|
batch.setPipeline(_cursorPipeline);
|
||||||
batch.setResourceTexture(0, _virtualPadStickTexture);
|
|
||||||
batch.resetViewTransform();
|
batch.setResourceTexture(0, _virtualPadStickBaseTexture);
|
||||||
batch.setModelTransform(stickTransform);
|
batch.setModelTransform(stickBaseTransform);
|
||||||
batch.setViewportTransform(ivec4(uvec2(0), getRecommendedRenderSize()));
|
|
||||||
batch.draw(gpu::TRIANGLE_STRIP, 4);
|
batch.draw(gpu::TRIANGLE_STRIP, 4);
|
||||||
});
|
|
||||||
if (!virtualPadManager.getLeftVirtualPad()->isBeingTouched()) {
|
batch.setResourceTexture(0, _virtualPadStickTexture);
|
||||||
// render stick head
|
batch.setModelTransform(stickTransform);
|
||||||
auto jumpTransform = DependencyManager::get<CompositorHelper>()->getPoint2DTransform(virtualPadManager.getJumpButtonPosition(),
|
batch.draw(gpu::TRIANGLE_STRIP, 4);
|
||||||
_virtualPadJumpBtnPixelSize, _virtualPadJumpBtnPixelSize);
|
|
||||||
render([&](gpu::Batch& batch) {
|
if (!virtualPadManager.getLeftVirtualPad()->isBeingTouched()) {
|
||||||
batch.enableStereo(false);
|
|
||||||
batch.setProjectionTransform(mat4());
|
|
||||||
batch.setPipeline(_cursorPipeline);
|
|
||||||
batch.setResourceTexture(0, _virtualPadJumpBtnTexture);
|
batch.setResourceTexture(0, _virtualPadJumpBtnTexture);
|
||||||
batch.resetViewTransform();
|
|
||||||
batch.setModelTransform(jumpTransform);
|
batch.setModelTransform(jumpTransform);
|
||||||
batch.setViewportTransform(ivec4(uvec2(0), getRecommendedRenderSize()));
|
|
||||||
batch.draw(gpu::TRIANGLE_STRIP, 4);
|
batch.draw(gpu::TRIANGLE_STRIP, 4);
|
||||||
});
|
}
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
Parent::compositeExtra();
|
Parent::compositeExtra();
|
||||||
|
|
Loading…
Reference in a new issue