Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-swt-dev] Flickering on Resize using lwjgl

Dear all,
after googling and searching mailing list archives, i decide to join
this mailing list to ask for help.
We are developing a video player using Eclipse RCP/SWT/lwjgl:
Our current eclipse version is:
3.5.2.R35x_v20100210-0800-9hEiFzmFst-TiEn9hNYgDWg1XN8ulH_JvCNGB
OS is: Windows 7
We have some flickering problems when there is a resize event.
There is a factory class that return a GLCanvas/Composite depending on
preferences

....
public static Composite getVideoPlaybackStage(Composite parent,
VideoModel vm, MediaPlayerModel model)
{
    IPreferenceStore store = Activator.getDefault().getPreferenceStore();
    boolean isOpenGL = store.getBoolean(VideoPreferencesCostants.OPEN_GL);
    Composite stage = createStage(parent, isOpenGL);
    VideoRepainter vrp = new VideoRepainter(stage, vm, model, isOpenGL);
    stage.setLayoutData(new GridData(GridData.FILL_BOTH));
    stage.addPaintListener(vrp);
    return stage;
}

private static Composite createStage(Composite parent, boolean isOpenGL)
{
    Composite stage;
    if (isOpenGL)
    {
        GLData glData = new GLData();
        glData.doubleBuffer = true;
        stage = new GLCanvas(parent, SWT.NO_BACKGROUND , glData);
    }
   else
   {
       stage = new Composite(parent, isMicrosoftWindows() ?
SWT.DOUBLE_BUFFERED : SWT.NONE);
       stage.setBackground(Colors.BLACK);
   }
   return stage;
}
....

and a class (VideoRepainter: http://snipt.org/ngkki/) which is in
charge to actually repaint the composite/canvas

We can solve the repaint flickering on resize using SWT.NONE instead
of  SWT.NO_BACKGROUND but the final result is worst,
because the background color is visible every 5/6 frame.

Do you have any suggestion?
Thanks in advance and I'm looking to hear news from you soon.
Regards,

Daniele

--
Daniele Di Mauro
http://www.facebook.com/daniele.dm
skype: daniele.dimauro
msn: mrgibber82@xxxxxxxxxxx
gtalk: daniele.dm@xxxxxxxxx


Back to the top