Flicker on Windows

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Post Reply
theAndreas
In need of some credit
In need of some credit
Posts: 9
Joined: Fri Aug 11, 2017 8:08 am

Flicker on Windows

Post by theAndreas »

Hello,

at the moment I am trying to develop a small Wordclock simulator. I started creating a frame based Application.

Image

The window should be refreshed every second. The problem is that I have a lot of flicker on Windows. On Linux its working great.

I also took a look inside the wxWiki https://wiki.wxwidgets.org/Flicker-Free_Drawing but that was not helpful at all.

I am using wxWidgets-3.0.3 and Windows 7

Is there something else what can be done?

Thanks for help!

Best regards Andreas
Attachments
testMain.h
(917 Bytes) Downloaded 70 times
testMain.cpp
(3.25 KiB) Downloaded 77 times
Last edited by theAndreas on Fri Aug 11, 2017 12:55 pm, edited 1 time in total.
User avatar
doublemax
Moderator
Moderator
Posts: 19158
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Flicker on Windows

Post by doublemax »

Do you get only flicker when you resize the frame or on every refresh?

I tested it under Window7 and i only get flicker on resize - which will be hard to avoid when using standard controls for the display.

To avoid flicker 100% you'll have to avoid the use of standard controls and use a panel with custom drawing instead. Depending on what features you might want to add, that's probably the most flexible solution anyway.
Use the source, Luke!
theAndreas
In need of some credit
In need of some credit
Posts: 9
Joined: Fri Aug 11, 2017 8:08 am

Re: Flicker on Windows

Post by theAndreas »

I get flicker on every refresh. Could you please try to set the Timer to a smaller value maybe 100. Then the flicker should get stronger.

Flicker on resize is not so a big problem. But flicker on every refresh is really ugly.

I already have read some posts about the problem with the standard controls. That's a pity because I really like wxWidgets, but that's not so nice. I hope this will be fixed in the next releases.
User avatar
doublemax
Moderator
Moderator
Posts: 19158
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Flicker on Windows

Post by doublemax »

Could you please try to set the Timer to a smaller value maybe 100. Then the flicker should get stronger.
No flicker for me on any refresh rate. Could be because i have Aero switched off.
That's a pity because I really like wxWidgets, but that's not so nice. I hope this will be fixed in the next releases.
This is very unlikely to change, it's a conceptional problem.

Can you try calling SetDoubleBuffered(true) on the frame?
Use the source, Luke!
theAndreas
In need of some credit
In need of some credit
Posts: 9
Joined: Fri Aug 11, 2017 8:08 am

Re: Flicker on Windows

Post by theAndreas »

Can you try calling SetDoubleBuffered(true) on the frame?
Thanks for the tip. This is really interesting: After adding SetDoubleBuffered the flicker is gone. But as soon as I change the size of the window, the flicker appears again on every refresh. But why?

Turned off Aero and also no flicker any more ;-). Seems to me its the only helpful option.
Attachments
testMain.cpp
(3.29 KiB) Downloaded 104 times
Post Reply