Closed lunabunn closed 3 years ago
Didn't mean to do that 😅
Looks good!
As for DeleteDC
that prompted me to look around a bit and I think the set_window
could use improvements:
None
is passed in then ReleaseDC
seems like it should still be called, presently it's not.None
is passed in does SetPixelFormat
just error?It also seems like in your Drop
implementation that if there's a current window and device context then ReleaseDC
should be called.
Is there ever a current window but not a DC or vice versa?
I was wondering that yesterday, and I don't think so. The Device Context (DC) is associated with a window. They could be coupled together as a tuple within an Option
instead of separate options.
Here's DeleteDC added to the drop, for now.
Cool. Is this ready to merge? We can fix-up the other things I mentioned later.
@kettle11 Sorry for the delay. Now it should be ready to merge!
Fix #8.
Questions: Where should we
DeleteDC
? Is it a good idea here to panic in theDrop
impl?