(Qt,Gtk)/OpenGL: Specify unpack alignment.

This commit is contained in:
BearOso 2023-10-08 11:03:27 -05:00
parent 0e03a36847
commit 01e408e4c8
2 changed files with 2 additions and 0 deletions

View File

@ -125,6 +125,7 @@ void S9xOpenGLDisplayDriver::update(uint16_t *buffer, int width, int height, int
update_texture_size(width, height);
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glPixelStorei(GL_UNPACK_ROW_LENGTH, stride_in_pixels);
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, width, height, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, buffer);

View File

@ -245,6 +245,7 @@ void EmuCanvasOpenGL::uploadTexture()
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glPixelStorei(GL_UNPACK_ROW_LENGTH, output_data.bytes_per_line / 2);
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB565, output_data.width, output_data.height, 0, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, output_data.buffer);
}