Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Icon not showing or flickering  (Read 3110 times)

0 Members and 1 Guest are viewing this topic.

gRuFtY

  • Newbie
  • *
  • Posts: 4
    • View Profile
Icon not showing or flickering
« on: October 30, 2015, 09:46:13 pm »
Hi!

I followed this tutorial to get an icon for my sfml-project. https://github.com/SFML/SFML/wiki/Tutorial:-Create-and-Use-SetIcon
I integrated the call to window.setIcon into my code, just after creating the window, but that did not work - the window had the default icon of my operating system. When I moved the call into my main loop it kinda worked like expected except the icon flickers. every few seconds parts of the icon disappear or change colours.
I don't really see why this would happen. It's like something overrides the rendering of the icon, but I don't know what could do that.

I tried a minimal example where the main method only created a window and had an empty loop (only calling window.display) and tried calling window.setIcon before and inside of the main loop, which had the same result. Is this a bug in my version of sfml or something like this? I'm on gentoo linux and using sfml version 2.3.2.

Where should the call to setIcon be placed? Should it still work like in the tutorial?
You can find my code on https://github.com/Gotos/Cute3DSCapture

I hope you can help. Thanks in advance!

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: Icon not showing or flickering
« Reply #1 on: October 30, 2015, 10:35:51 pm »
Hi!
Hello!

I tried a minimal example where the main method only created a window and had an empty loop (only calling window.display) and tried calling window.setIcon before and inside of the main loop, which had the same result. Is this a bug in my version of sfml or something like this? I'm on gentoo linux and using sfml version 2.3.2.
It would be helpful if you posted here the minimal code that you mentioned so that it can be tested by others and it's much more likely that people would want to help solve your issue using the minimal code than your full project.

Setting the icon only needs to be done once, after window creation, not constantly inside the main loop.
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

mkalex777

  • Full Member
  • ***
  • Posts: 206
    • View Profile
Re: Icon not showing or flickering
« Reply #2 on: October 31, 2015, 10:18:03 pm »
I noticed that icon appears with 1-2 seconds delay after seticon call. Actually it shows default window icon for 1-2 seconds, although seticon was called before setvisible(true). So, may be it related to your issue
« Last Edit: October 31, 2015, 10:20:38 pm by mkalex777 »

gRuFtY

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Icon not showing or flickering
« Reply #3 on: November 03, 2015, 02:58:43 pm »
It would be helpful if you posted here the minimal code that you mentioned so that it can be tested by others and it's much more likely that people would want to help solve your issue using the minimal code than your full project.

Thanks for you're reply! I don't have the code at hand, but it really was just a window creation followed by the setIcon and an empty loop. I'll post the exact code later, when I have it available.

I noticed that icon appears with 1-2 seconds delay after seticon call. Actually it shows default window icon for 1-2 seconds, although seticon was called before setvisible(true). So, may be it related to your issue

Yeah, sounds like it could be related.