0

How to enable something like v-sync in the freeglut program, is there a way to reduce screen tearing such as possibly properly syncing up the monitor refresh rate with the frames pushed out of the program? is there possibly a library that I could use that already contains something that could take care of this? I have found tutorials for "wglSwapIntervalEXT" but I have not found any simple tutorial in its bare form. I have my freeglut program in fullscreen and there seems to be screen tearing that I can't figure out how to fix.

genpfault
  • 51,148
  • 11
  • 85
  • 139
  • What GPU do you have? Do you create a double-buffered context? Do you have proper drivers installed? To my best knowledge V-sync is turned on by default at least as far as nvidia is concerned. – Yakov Galka Dec 21 '19 at 04:25
  • Set swap interval to 1 and your program will do v-sync. There is no tutorial because it is too simple to make a tutorial around. – Andreas Dec 21 '19 at 14:24
  • I am using intel integrated graphics. Ok, I am sorry that this question has an answer that seems to be a waste of time but for the life of me I cannot figure out the command to set the swap interval. Can you possibly link to an example code that shows swap interval in use? Thanks for all of your help. – Isaac Ratliff Dec 22 '19 at 02:28
  • When setting the display mode use double buffers. EG `glutInitDisplayMode(GLUT_DOUBLE);` At the end of the display function call `glutSwapBuffers();` If the GPU/Display device is configured to sync to the display you need only then call `glutPostRedisplay();` If hardware is not set to sync you will have to use `glutTimerFunc(1000/60` but this will not be in sync with hardware only in tune/time (eg shearing will hover at a fixed pos on the display) – Blindman67 Sep 05 '21 at 03:25

0 Answers0