Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fixed the screen flickering issue when resizing the window from … #616

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zzxzzk115
Copy link

…the bottom.

Describe the issue (if no issue has been made)

A lot of people may have overlooked an issue where there is a flicker or delay in the screen when adjusting the window size from below the window. This is due to the improper handling of GLFW input events timing. We should handle input events at the beginning of the main loop, instead of handling events and swapping buffers at the end of rendering.

PR impact (Make sure to add closing keywords)

List of related issues/PRs this will solve:

Impact Issue/PR
Issues this solves None or #number(s)
Other PRs this solves None or #number(s)

Proposed fix (Make sure you've read on how to contribute to Hazel)

Add a new interface method OnRender in Window.h, move the SwapBuffer operation to OnRender, and move the glfwPollEvents operation to OnUpdate. Call the window's OnUpdate at the beginning of the main loop in Application and call OnRender at the end of the render pipeline. Further discussion may be needed for naming, it could also be OnPreUpdate and OnLateUpdate, but for now, OnUpdate and OnRender should be more appropriate according to the current logic.

Additional context

Tested on Windows 10, 19041.264

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant