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

Author Topic: Background flickering  (Read 2298 times)

0 Members and 1 Guest are viewing this topic.

Eralpb

  • Newbie
  • *
  • Posts: 3
    • View Profile
Background flickering
« on: January 03, 2011, 12:34:29 pm »
Hello I wonder what could be causing my background to flicker when I move my character & custom view.

I searched for some time and found two things
1)drawing sprites with float coordinates
2)Image may be too big for video card to handle easily

and I am now casting the coordinates to integers and  I tried loading an image like 500*500 but I still have the same issue.

how does it flicker?
borders are like filling this way, take 10 pixels width, fill it from down to up then take 10 pixels more. while the "not yet filled" up parts stay black.
Sorry If I coulnd't explain it well:)

I can't take a screenshot because when I try to take, the game freezes for a moment and borders seem normal in screenshots.

And I don't know which part of my code to post since I have like 15 headers and I can't seem to guess what is causing this.

Thanks :)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Background flickering
« Reply #1 on: January 03, 2011, 01:28:20 pm »
Try to activate vertical synchronization (window.UseVerticalSync(true)).

If it doesn't help, I'm afraid you'll have to extract a minimal and complete piece of code that reproduces this problem, so that we can test and debug it.
Laurent Gomila - SFML developer

Eralpb

  • Newbie
  • *
  • Posts: 3
    • View Profile
Background flickering
« Reply #2 on: January 03, 2011, 01:57:03 pm »
Thanks! Activating vertical synchronization seems to solve my problem, but shouldn't double buffering solve that tearing or flickering?

Can anyone explain if that won't take too long. I was closing vsycnh when I was playing or coding games whenever I see that option. So what brings turning that on? Will it work with other computers and what changes should I make if any?
I heard it was for CRT monitors by the way

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Background flickering
« Reply #3 on: January 03, 2011, 02:37:28 pm »
Quote
Thanks! Activating vertical synchronization seems to solve my problem, but shouldn't double buffering solve that tearing or flickering?

No, only synchronizing with the monitor's refresh rate can produce a perfect image.

Quote
Can anyone explain if that won't take too long. I was closing vsycnh when I was playing or coding games whenever I see that option. So what brings turning that on? Will it work with other computers and what changes should I make if any?

It's generally a good thing to have v-sync enabled, to avoid this kind of problems. It will work for all computers.
Laurent Gomila - SFML developer

 

anything