Slowing Down the Visualization Speed in OpenGL

  • FowadM
    Likes 0

    Problem Description

    Hi. Thank you for this great website. I need your help; I have written a C++/OpenGL code that basically draws a horizontal line above three squares. The vertices of the line are updating (GL_DYNAMIC_DRAW in its glBufferData) every time it goes through a for loop, while the window is open. everything seems to be working fine, the only problem is that the resulting 2D visualization is extremely rapid! I need it to be very much slower so that I could look at the movement of the line more precisely. Is there any function in GLFW that I could call in order to adjust the speed of going through that for loop basically? Please help me with this question, I’m really close to an important deadline and I need to get this code to work asap! Thank you.


  • Sonar Systems admin
    Likes 0

    Have you tried factoring in delta time?


    This reply has been verified.
  • FowadM
    Likes 0

    thanks for your reply. I found a kind of ugly way to reach my purpose for now! ugly because it’s very inefficient! basically, I added another for loop in which I draw just a random point so that I could delay the process of going through the main for loop in which I draw other meaningful objects. It works for now, although it’s very unsophisticated and needs serious optimizations!

  • Sonar Systems admin
    Likes 0

    I’m sure you will improve it :D

  • FowadM
    Likes 1

    thanks :D

  • Sonar Systems admin
    Likes 0

    Your welcome, if you have anymore questions feel free to post them.

Login to reply