1
0
Fork 0

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
This commit is contained in:
Peter Veenstra 2019-05-26 09:07:07 +00:00
parent 5888c05dd1
commit ee236a7e5a

View file

@ -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);