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

Author Topic: Flicker in winform when using WS_EX_COMPOSITED  (Read 713 times)

0 Members and 1 Guest are viewing this topic.

YONGWOO KIM

  • Newbie
  • *
  • Posts: 1
    • View Profile
Flicker in winform when using WS_EX_COMPOSITED
« on: July 21, 2022, 08:58:20 am »
It was OK, before I add this code.

protected override CreateParams CreateParams
        {
            get
            {
                CreateParams handleParam = base.CreateParams;
                handleParam.ExStyle |= 0x02000000;   // WS_EX_COMPOSITED      
                return handleParam;
            }
        }

I have to use this code, but I don't know how to remove flicker.

Is there any solution?

This is my code when sfml is shown

            m_renderSurface = new PictureBox();
            m_renderSurface.Location = new System.Drawing.Point(0, 0);
            m_renderSurface.Size = new System.Drawing.Size(m_parentPanel.Size.Width, m_parentPanel.Size.Height);
            m_parentPanel.Controls.Add(m_renderSurface);

            SFML.Window.ContextSettings setting = new SFML.Window.ContextSettings();
            setting.AntialiasingLevel = 8;

            m_renderWindow = new SFML.Graphics.RenderWindow(m_renderSurface.Handle, setting);
            m_renderWindow.SetVerticalSyncEnabled(true);
            m_renderWindow.SetVisible(true);

            while (m_renderWindow.IsOpen)
            {
                try
                {
                    System.Windows.Forms.Application.DoEvents();
                    m_renderWindow.DispatchEvents();
                    m_renderWindow.Clear(colorWindow);

                    SetItems();
                    DrawItems();

                    m_renderWindow.Display();
                }
                catch
                {
                    break;
                }
            }
« Last Edit: July 21, 2022, 10:58:52 am by eXpl0it3r »

 

anything