Merge pull request #11455 from unknownbrackets/android-resize

Android: Fix Vulkan immersive startup
This commit is contained in:
Henrik Rydgård authored and GitHub committed 2018-10-08 07:52:47 +02:00
commit a0b019d473
3 files changed
+35 -27

No files matched your search

+4 -1
View File
@@ -133,6 +133,7 @@ static UI::Theme ui_theme;
ScreenManager *screenManager;
std::string config_filename;
bool g_graphicsIniting;
bool g_graphicsInited;
// Really need to clean this mess of globals up... but instead I add more :P
@@ -747,6 +748,7 @@ static void UIThemeInit() {
void RenderOverlays(UIContext *dc, void *userdata);
bool NativeInitGraphics(GraphicsContext *graphicsContext) {
g_graphicsIniting = true;
ILOG("NativeInitGraphics");
_assert_msg_(G3D, graphicsContext, "No graphics context!");
@@ -823,6 +825,7 @@ bool NativeInitGraphics(GraphicsContext *graphicsContext) {
gpu->DeviceRestore();
g_graphicsInited = true;
g_graphicsIniting = false;
ILOG("NativeInitGraphics completed");
return true;
}
@@ -1244,7 +1247,7 @@ void NativeMessageReceived(const char *message, const char *value) {
void NativeResized() {
// NativeResized can come from any thread so we just set a flag, then process it later.
if (g_graphicsInited) {
if (g_graphicsInited || g_graphicsIniting) {
resized = true;
} else {
ILOG("NativeResized ignored, not initialized");