Initialize render target when window size is not specified on Windows#1575
Merged
cmyr merged 1 commit intolinebender:masterfrom Feb 17, 2021
Merged
Conversation
Collaborator
|
This also fixes #1582. I'm okay with this patch for the time being (I don't know the side effects of creating DC during WM_CREATE either but it worked). Reason is that way render_target is created is really unorthodox at the moment, I might make a bigger PR to refactor whole render_target creation. Usually DC or equivalent is created on demand during render (e.g. WM_PAINT). Right now the |
cmyr
approved these changes
Feb 17, 2021
Member
cmyr
left a comment
There was a problem hiding this comment.
Okay, I'm happy to merge this as a hotfix with the understanding that we would like a more robust solution longer-term.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix #1426.
As I commented on that issue, When the window size is not specified, WM_RESIZE is not emitted before first WM_PAINT. So, rendering is called without creating the render target.
I tested on Windows 10 Pro 20H2. With this patch, all examples are successfully showing the window without panic.