I am using the OpenTK and c#. I have developed a graphics application that works fine but is slow. I need help to improve the performance of the application. My application generates a model that is made up of several elements. This is what I do for each element :
1- test if element has a result.
2- open file and read the result of each element.
3- choice the color of the element switch of the value of the result.
4- draw the element.
I'm new in opentk, when i follow the execution of my program, i note that my program return to glcontrol1_paint many times ( and in my program i call once time).
i think that 's why my program is slow.
my function glControl1_Paint,
private void glControl1_Paint(object sender, PaintEventArgs e)
GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
GL.Translate(x, 0, 0);
GL.Translate(0, y, 0);
GL.Translate(0, 0, z);
GL.Translate(xp, yp, zp);
GL.Translate(-xp, -yp, -zp);
GL.Scale(scale, scale, scale);
i like to know how do eliminate the repetition not wanted.