From ee236a7e5a07935b773835f256895c7211e242ce Mon Sep 17 00:00:00 2001 From: Peter Veenstra Date: Sun, 26 May 2019 09:07:07 +0000 Subject: [PATCH] Init texture with zeroes. Should fix the red border with pixel_buffer and nvidia cards on Mac OS X and Linux. Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4228 --- src/gui/sdlmain.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gui/sdlmain.cpp b/src/gui/sdlmain.cpp index 7df007fc..24807125 100644 --- a/src/gui/sdlmain.cpp +++ b/src/gui/sdlmain.cpp @@ -728,7 +728,10 @@ dosurface: glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); } - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, texsize, texsize, 0, GL_BGRA_EXT, GL_UNSIGNED_BYTE, 0); + Bit8u* emptytex = new Bit8u[texsize * texsize * 4]; + memset((void*) emptytex, 0, texsize * texsize * 4); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, texsize, texsize, 0, GL_BGRA_EXT, GL_UNSIGNED_BYTE, (const GLvoid*)emptytex); + delete [] emptytex; glClearColor (0.0, 0.0, 0.0, 1.0); glClear(GL_COLOR_BUFFER_BIT);