Why is my rotating cube flickering? #8014
Answered
by
HappySapeta
HappySapeta
asked this question in
Q&A
-
Beta Was this translation helpful? Give feedback.
Answered by
HappySapeta
Aug 6, 2024
Replies: 1 comment
-
My update loop was missing vsync implementation. // Delay rendering for roughly one monitor refresh interval
SDL_DisplayMode Mode;
int refreshIntervalMS = (SDL_GetDesktopDisplayMode(
SDL_GetWindowDisplayIndex(window_), &Mode) == 0 &&
Mode.refresh_rate != 0) ? round(1000.0 / Mode.refresh_rate) : 16;
SDL_Delay(refreshIntervalMS); and these lines at the end should be removed : SDL_GL_SwapWindow(window_);
glClear(GL_COLOR_BUFFER_BIT); |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
HappySapeta
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
My update loop was missing vsync implementation.
and these lines at the end should be removed :