mirror of https://github.com/mgba-emu/mgba.git
Switch: Fix switching between PBO and FBO games
This commit is contained in:
parent
d025dd5704
commit
89c37820c6
|
@ -252,6 +252,9 @@ static void _setup(struct mGUIRunner* runner) {
|
||||||
runner->core->setVideoGLTex(runner->core, tex);
|
runner->core->setVideoGLTex(runner->core, tex);
|
||||||
usePbo = false;
|
usePbo = false;
|
||||||
} else {
|
} 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);
|
runner->core->setVideoBuffer(runner->core, frameBuffer, 256);
|
||||||
usePbo = true;
|
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_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
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);
|
glGenBuffers(1, &pbo);
|
||||||
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, pbo);
|
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, pbo);
|
||||||
|
|
Loading…
Reference in New Issue