mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-26 03:38:55 +01:00
devicescale: Refactoring: define Windows error consts
This commit is contained in:
parent
75a024e40e
commit
db1b664424
@ -190,8 +190,16 @@ func getDpiForMonitor(hMonitor uintptr, dpiType uintptr, dpiX, dpiY uintptr) err
|
||||
func getFromLogPixelSx() float64 {
|
||||
dc, err := getWindowDC(0)
|
||||
if err != nil {
|
||||
const (
|
||||
errorInvalidWindowHandle = 1400
|
||||
errorResourceDataNotFound = 1812
|
||||
)
|
||||
// On Wine, it looks like GetWindowDC(0) doesn't work (#738, #743).
|
||||
if code := err.(*winErr).Code; code == 1400 || code == 1812 {
|
||||
code := err.(*winErr).Code
|
||||
if code == errorInvalidWindowHandle {
|
||||
return 1
|
||||
}
|
||||
if code == errorResourceDataNotFound {
|
||||
return 1
|
||||
}
|
||||
panic(err)
|
||||
|
Loading…
Reference in New Issue
Block a user