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

Author Topic: [FIXED] Flashing screen on loading/alt-tab  (Read 8581 times)

0 Members and 1 Guest are viewing this topic.

ZeroZ30o

  • Newbie
  • *
  • Posts: 47
    • View Profile
[FIXED] Flashing screen on loading/alt-tab
« on: February 17, 2016, 11:17:44 pm »
The screen flashes when sfml loads and when you alt tab - and displays the last picture that appeared on the last focus lost when doing a prt scrn (print screen).

(Trying to figure out if this is OS related)

· Works on:
   (1 computers) Windows 7 home premium edition 64 bit + AMD Radeon HD 6870
   (1 computers) Windows 7 home edition 64 bit
   (1 computer) Windows XP (?) edition (?) bit
   (2 computers) Linux (?) - On wine
   (1 computer) Windows 10 professional edition 64 bit + AMD Radeon HD 7570

· Bugs on:
   (1 computer) Windows 7 professional edition 64 bit + NVIDIA GeForce GTX 660 Ti
   (1 computer) Windows 7 ultimate edition 64 bit + NVIDIA GeForce GTX 650 Ti
   (1 computers) Windows 7 home edition 64 bit + AMD Radeon HD 5850M

EDIT: I don't know when this has started happening, but this is a very very old issue (about 80 versions).

EDIT: It still happens on "fullscreen" window style.

EDIT: It does not happen on borderless windowed mode IF the resolution is not your fullscreen resolution (aka 1279x1023 instead of 1280x1024).

When in the level in game:
http://puu.sh/nbIDO/8503238474.png

What shows up when you print screen (even tho this is not what you see):
http://puu.sh/nbID0/27202d40ad.jpg


I use windows 7 and have tested this on other machines. I've heard this works fine on Wine (linux) without any weird snapshot.


Window code:
   sf::RenderWindow window(sf::VideoMode(control.resolution.x, control.resolution.y), "SBA",sf::Style::None);
    window.setFramerateLimit(60);
    window.setVerticalSyncEnabled(false);

I really don't know what is relevant for this, so please do ask for specific parts of code. It may be OS-specific, or hardware stuff... I really have no clue (hence why I posted in general and not window).

Here is a link of the game for testing:
https://mega.nz/#!K1YXgLDS!Im9vt4_NOnnII2Nb5yuczET3Pvkfj05LwaURNYcJtoI
« Last Edit: February 25, 2016, 03:07:07 pm by ZeroZ30o »

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: Flashing screen on loading/alt-tab
« Reply #1 on: February 18, 2016, 02:25:02 am »
   sf::RenderWindow window(sf::VideoMode(control.resolution.x, control.resolution.y), "SBA",sf::Style::None);
    window.setFramerateLimit(60);
    window.setVerticalSyncEnabled(false);
Quote
Never use both setVerticalSyncEnabled and setFramerateLimit at the same time! They would badly mix and make things worse.
Although, it may be not the cause of your problem.
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

G.

  • Hero Member
  • *****
  • Posts: 1593
    • View Profile
Re: Flashing screen on loading/alt-tab
« Reply #2 on: February 18, 2016, 05:25:29 am »
He set it to false so it's OK. ;)

ZeroZ30o

  • Newbie
  • *
  • Posts: 47
    • View Profile
Re: Flashing screen on loading/alt-tab
« Reply #3 on: February 18, 2016, 09:05:03 am »
Just tested on another computer (windows XP 2002) and it doesn't flash and prints the screen correctly.

Not sure if it's even fixable inside the code. Maybe something about focus?
« Last Edit: February 18, 2016, 09:21:57 am by ZeroZ30o »

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: Flashing screen on loading/alt-tab
« Reply #4 on: February 19, 2016, 12:30:22 am »
He set it to false so it's OK. ;)
I was tired :P
You're right, of course. I was wrong there. Well, I was right in what I said but wrong in the reasons I used to say it.  ;D
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

ZeroZ30o

  • Newbie
  • *
  • Posts: 47
    • View Profile
Re: Flashing screen on loading/alt-tab
« Reply #5 on: February 19, 2016, 12:33:18 am »
He set it to false so it's OK. ;)
I was tired :P
You're right, of course. I was wrong there. Well, I was right in what I said but wrong in the reasons I used to say it.  ;D

So no idea of what it is ;w;?

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: Flashing screen on loading/alt-tab
« Reply #6 on: February 19, 2016, 12:43:55 am »
I've not done much testing with Alt-Tab so I don't know well how SFML reacts.
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

ZeroZ30o

  • Newbie
  • *
  • Posts: 47
    • View Profile
Re: [FIXED] Flashing screen on loading/alt-tab
« Reply #7 on: February 25, 2016, 03:07:53 pm »
Fixed, by updating SFML 2.0 to SFML 2.3 (I don't know how I had 2.0 either).

However the print screen problem still happens, but the screen does not flicker anymore.