Change GL framebuffer if max geometry is different

This commit is contained in:
Sergey Stepanov 2024-07-14 19:33:32 +03:00
parent d8a3e82f1e
commit 83b040b39f
No known key found for this signature in database
GPG key ID: A56B4929BAA8556B

View file

@ -896,7 +896,7 @@ func geometryChange(geom C.struct_retro_game_geometry) {
old := Nan0.sys.av.geometry
Nan0.sys.av.geometry = geom
if Nan0.Video.gl.enabled {
if Nan0.Video.gl.enabled && (old.max_width != geom.max_width || old.max_height != geom.max_height) {
bufS := uint(geom.max_width*geom.max_height) * Nan0.Video.PixFmt.BPP
graphics.SetBuffer(int(bufS))
Nan0.log.Debug().Msgf("OpenGL frame buffer: %v", byteCountBinary(int64(bufS)))