Commit 88f90a19 authored by Richard Gobeille's avatar Richard Gobeille
Browse files

engine: fix Discord streaming issue

Fixes #152
parent ae52bec9
......@@ -36,4 +36,7 @@ vec2_t glsurface_getBufferResolution();
// If the surface is not initialized, the function returns immediately.
void glsurface_blitBuffer();
// Rebind texture
void glsurface_refresh();
#endif /* GLSURFACE_H_ */
......@@ -240,3 +240,9 @@ void glsurface_blitBuffer()
0,
4);
}
void glsurface_refresh()
{
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, bufferTexID);
}
......@@ -641,6 +641,7 @@ void polymost_resetProgram()
polymost_activeTexture(GL_TEXTURE2);
polymost_bindTexture(GL_TEXTURE_2D, paletteTextureIDs[curbasepal]);
polymost_activeTexture(GL_TEXTURE0);
currentTextureID = 0;
}
static void polymost_setCurrentShaderProgram(uint32_t programID)
......
......@@ -1957,6 +1957,12 @@ void videoShowFrame(int32_t w)
MicroProfileFlip();
// attached overlays and streaming hooks tend to change the GL state without setting it back
if (bpp > 8)
polymost_resetVertexPointers();
else
glsurface_refresh();
return;
}
#endif
......
......@@ -1808,6 +1808,9 @@ void videoShowFrame(int32_t w)
fullscreen_tint_gl(palfadergb.r, palfadergb.g, palfadergb.b, palfadedelta);
SwapBuffers(hDC);
#ifdef USE_OPENGL
polymost_resetVertexPointers();
#endif
return;
}
#endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment