mirror of https://github.com/snes9xgit/snes9x.git
(Qt,Gtk)/OpenGL: Specify unpack alignment.
This commit is contained in:
parent
0e03a36847
commit
01e408e4c8
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue