| Summary: | Can't detect if mouse is inside the window on Windows | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Sik <sik.the.hedgehog> |
| Component: | *don't know* | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED WORKSFORME | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | ||
| Version: | HG 2.0 | ||
| Hardware: | x86 | ||
| OS: | Windows (All) | ||
| Attachments: | Modified testgl2.c | ||
|
Description
Sik
2012-11-04 23:13:06 UTC
Created attachment 1217 [details]
Modified testgl2.c
This is working for me here on Windows. We might have fixed it at some point.
I've attached a modified testgl2.c to demonstrate a working example. Just copy it over the one in the test directory and rebuild. It'll OutputDebugString() a 1 when the app gets mouse focus (by the cursor entering the window) and a 0 when it loses it (by the cursor leaving the window).
Note that this only works if you pump the SDL event loop. If SDL hasn't gotten the event from Windows yet, it thinks the mouse focus hasn't changed.
--ryan.
|