ebiten: Bug: text flickering when resizing screen.

Problem

Strange text flickering with minimal settings.

glitch

Happens with this:

text.Draw()
ebitenutil.DebugPrintAt()
text.DrawWithOptions()

And this:

ebiten.SetWindowResizingMode(ebiten.WindowResizingModeEnabled)
ebiten.SetFPSMode(/* any value, can be ignored */)
if err := ebiten.RunGame(/* your text rendering functions */); err != nil {
	log.Fatal(err)
}

Specs

require github.com/hajimehoshi/ebiten/v2 v2.3.3
inxi -Fxz

System:
  Kernel: 5.4.0-91-generic x86_64 bits: 64 compiler: gcc v: 9.3.0 
  Desktop: Cinnamon 5.0.7 Distro: Linux Mint 20.2 Uma 
  base: Ubuntu 20.04 focal 
Machine:
  Type: Desktop Mobo: ASRock model: B450 Pro4 serial: <filter> 
  UEFI [Legacy]: American Megatrends v: P3.60 date: 07/31/2019 
CPU:
  Topology: 6-Core model: AMD Ryzen 5 3600 bits: 64 type: MT MCP arch: Zen 
  L2 cache: 3072 KiB 
  flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm 
  bogomips: 86238 
  Speed: 2196 MHz min/max: 2200/3600 MHz Core speeds (MHz): 1: 2196 2: 2196 
  3: 2195 4: 2196 5: 2195 6: 2196 7: 2196 8: 2196 9: 2195 10: 2196 11: 2196 
  12: 2196 
Graphics:
  Device-1: AMD Navi 10 [Radeon RX 5600 OEM/5600 XT / 5700/5700 XT] 
  driver: amdgpu v: kernel bus ID: 0c:00.0 
  Display: x11 server: X.Org 1.20.13 driver: amdgpu,ati 
  unloaded: fbdev,modesetting,radeon,vesa resolution: 2560x1440~60Hz 
  OpenGL: renderer: AMD Radeon RX 5700 XT (NAVI10 DRM 3.35.0 
  5.4.0-91-generic LLVM 12.0.0) 
  v: 4.6 Mesa 21.0.3 direct render: Yes 
Audio:
  Device-1: AMD Navi 10 HDMI Audio driver: snd_hda_intel v: kernel 
  bus ID: 0c:00.1 
  Device-2: AMD Starship/Matisse HD Audio vendor: ASRock 
  driver: snd_hda_intel v: kernel bus ID: 0e:00.4 
  Device-3: Realtek USB2.0 Microphone type: USB 
  driver: hid-generic,snd-usb-audio,usbhid bus ID: 3-1:2 
  Sound Server: ALSA v: k5.4.0-91-generic 
Network:
  Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet 
  vendor: ASRock driver: r8169 v: kernel port: d000 bus ID: 09:00.0 
  IF: enp9s0 state: up speed: 100 Mbps duplex: full mac: <filter> 
  IF-ID-1: br-ed9eba69972d state: down mac: <filter> 
  IF-ID-2: docker0 state: down mac: <filter> 
Drives:
  Local Storage: total: 2.41 TiB used: 976.98 GiB (39.7%) 
  ID-1: /dev/nvme0n1 vendor: Silicon Power model: SPCC M.2 PCIe SSD 
  size: 953.87 GiB 
  ID-2: /dev/sda vendor: Seagate model: ST9500325AS size: 465.76 GiB 
  temp: 37 C 
  ID-3: /dev/sdb vendor: Seagate model: ST1000DM010-2EP102 size: 931.51 GiB 
  temp: 41 C 
  ID-4: /dev/sdc vendor: Western Digital model: WDS120G2G0B-00EPW0 
  size: 111.80 GiB temp: 46 C 
Partition:
  ID-1: / size: 937.40 GiB used: 369.97 GiB (39.5%) fs: ext4 
  dev: /dev/nvme0n1p5 
Sensors:
  System Temperatures: cpu: 57.1 C mobo: N/A gpu: amdgpu temp: 48 C 
  Fan Speeds (RPM): N/A gpu: amdgpu fan: 1215 
Info:
  Processes: 494 Uptime: 8h 05m Memory: 15.57 GiB used: 13.99 GiB (89.9%) 
  Init: systemd runlevel: 5 Compilers: gcc: 9.3.0 Shell: bash v: 5.0.17 
  inxi: 3.0.38 

echo $XDG_SESSION_TYPE
x11

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 19 (17 by maintainers)

Commits related to this issue

Most upvoted comments

What about v2.6.0-alpha.3?

Oh, I see. It now only changes at the end of the resize. Looks like it working for Win 10. Testring on Linux Mint 20.2. ebiten.ReadDebugInfo(...) outputs DirectX

ebitengine-good-scaling-win10

A better demonstration of what’s going on.

  • This seems to occur with any rendering using screen.Bounds().
  • This problem does not occur on MacOS.
  • On windows, resizing a window along one border also causes it to shrink along the other border (maybe its worth to create a separate issue for this).

Linux Mint 20.2 Uma:

Windows 10 Pro 10.0.19044 build 19044:

https://user-images.githubusercontent.com/19890545/194299435-25a9a8fe-2f22-4394-8442-2448d8c24dda.mp4