Switch: Fix switching between PBO and FBO games

This commit is contained in:
Vicki Pfau 2019-05-27 00:06:10 -07:00
parent d025dd5704
commit 89c37820c6
1 changed files with 3 additions and 1 deletions

View File

@ -252,6 +252,9 @@ static void _setup(struct mGUIRunner* runner) {
runner->core->setVideoGLTex(runner->core, tex);
usePbo = false;
} else {
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, tex);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 256, 256, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
runner->core->setVideoBuffer(runner->core, frameBuffer, 256);
usePbo = true;
}
@ -557,7 +560,6 @@ int main(int argc, char* argv[]) {
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 256, 256, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
glGenBuffers(1, &pbo);
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, pbo);