From eac417cdc1c1b8a3cc0cde5b09d74d6492dc5d2d Mon Sep 17 00:00:00 2001 From: Clownacy Date: Wed, 23 Sep 2020 16:52:42 +0100 Subject: [PATCH] I guess I figured out what the GX2 context is for --- src/Backends/Rendering/WiiU.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Backends/Rendering/WiiU.cpp b/src/Backends/Rendering/WiiU.cpp index 25f96901..95c896a0 100644 --- a/src/Backends/Rendering/WiiU.cpp +++ b/src/Backends/Rendering/WiiU.cpp @@ -240,8 +240,9 @@ RenderBackend_Surface* RenderBackend_Init(const char *window_title, size_t scree if (framebuffer_surface != NULL) { - // Create a 'context' (this voodoo magic can be used to undo `GX2SetColorBuffer`, - // allowing us to draw to the screen once again) + // From what I can tell, there isn't a 'global context' in GX2: instead there are context objects. + // wut internally uses (and *switches to*) its own contexts, so we need to maintain one too, + // and make sure we're always switching back to it when wut is done doing what it's doing. gx2_context = (GX2ContextState*)aligned_alloc(GX2_CONTEXT_STATE_ALIGNMENT, sizeof(GX2ContextState)); if (gx2_context != NULL) @@ -445,7 +446,7 @@ void RenderBackend_DrawScreen(void) WHBGfxFinishRender(); - // Do this or else the screen will never update. I wish I understood why. + // Switch back to our context GX2SetContextState(gx2_context); }