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

Author Topic: opengl flicker overlap riddance  (Read 23530 times)

0 Members and 1 Guest are viewing this topic.

vurentjie

  • Newbie
  • *
  • Posts: 31
    • View Profile
opengl flicker overlap riddance
« on: March 26, 2008, 08:55:31 pm »
hi i don't know if you have ever noticed that when you run an opengl app on windows xp that has been built with sfml, if you hover your mouse over the bottom windows taskbar and wait for a pop-up hint to display,if this pop up hint overlap the opengl window it flickers madly, it happens on the edges of the start menu as well, i dont know why, but it is an ugly thing to see, it happens with sdl as well, i wonder what causes it?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
opengl flicker overlap riddance
« Reply #1 on: March 27, 2008, 01:49:21 am »
I think it has 2 main reasons :
- The whole window is repainted, not only the visible region
- The window is always repainted, not only when the window is told to be refreshed
Laurent Gomila - SFML developer

vurentjie

  • Newbie
  • *
  • Posts: 31
    • View Profile
repainted?
« Reply #2 on: March 27, 2008, 04:20:12 pm »
ja, it is a strange matter, is there not any way to stop the window or 'pause/unpause' it when the mouse enters/exits the window, but that is actually stupid cos what would happen to animated stuffs.

but sadly i am going to have to live with it for now, there must be some way to fix it i am thinking, but wouldnt know where to start, i know that glut is the only opengl extension lib (that i have tried) that doesnt have this issue, but glut lacks with a lot of other things, so as i am not an experienced enough coder to get into the nitty gritty of opengl support, i am going to have to wait it out......mmm....where would one start to learn about the intrinsics of this stuff?

thanks for the reply

vurentjie

  • Newbie
  • *
  • Posts: 31
    • View Profile
understand cause now...
« Reply #3 on: March 28, 2008, 12:34:08 am »
ok this should really not be in this thread anymore, i understand what the cause is, but have not got a fully workin solution,
basically i need to halt drawing/repainting while waiting for next event to take place that way the window is not persistently repaint, any advice??

you may move this thread if you please.

Caspin

  • Newbie
  • *
  • Posts: 10
    • MSN Messenger - j_nick_terry@hotmail.com
    • View Profile
stop calling sf::RenderWindow::Display
« Reply #4 on: April 10, 2008, 05:40:27 pm »
stop calling sf::RenderWindow::Display every frame.  It is truly as simple as that.

Your problems will arise when you actually want the window to update.  In theory you can use glViewPort to set which section of the screen gets drawn to so you could just render those sections, but that will get out of control fast.  Either you build a update rect around every thing that has changed, likely the whole screen, or you render your game multiple times.  Just figuring out which sections of you game have changed can be a problem.  You'll have to design your entire render system with the update rects in mind.

-use glViewPort to select which section of the screen you want updated
-work some magic with sf::View to make sure the right part of your game is render to update rect.
-call Display after each glViewPort/update rect is set.

-nick

vurentjie

  • Newbie
  • *
  • Posts: 31
    • View Profile
opengl flicker overlap riddance
« Reply #5 on: June 22, 2008, 10:29:10 pm »
i haven't looked at this post in a long time, should've come back here, yes, duh, thanks, i did sort out my problem quite a while ago, it was realy simple yes, i was a bit of a banana!

 

anything