This is happening in Delphi too so i'm unsure if it's OpenGL related or Windows.
Basically I have dropped a TOpenGLControl on the form and in the Paint event:
procedure TForm1.OpenGLControl1Paint(Sender: TObject);
begin
glViewport(0, 0, OpenGLControl1.ClientWidth, OpenGLControl1.ClientHeight);
glMatrixMode(GL_PROJECTION);
glLoadIdentity;
glOrtho(0, OpenGLControl1.ClientWidth, OpenGLControl1.ClientHeight, 0, -1, 1);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity;
glClearColor(0.3, 0.3, 0.3, 1.0);
glClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT);
glColor3f(0.0, 0.0, 1.0);
glBegin(GL_QUADS);
glVertex2f(0, 0);
glVertex2f(256, 0);
glVertex2f(256, 256);
glVertex2f(0, 256);
glEnd;
OpenGLControl1.SwapBuffers;
end;
It's just a simple rectangle shown in the top left, 256x256 in size.
When resizing the Window it causes the rectangle to distort / flicker.
OpenGLControl1 is aligned to client and parented on the form itself, setting AutoResizeViewport makes no difference (Windows 11 ).
Not sure if this is a code issue or Windows 11 issue, i have a Nvidia graphics card if that matters.
Any ideas as to what may be causing it? Unfortunately i'm unable to screenshot the effect.