mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
internal/microsoftgdk: improve forward compatibility
This commit is contained in:
parent
8b588587cc
commit
0c072894b5
@ -63,6 +63,8 @@ func IsXbox() bool {
|
|||||||
|
|
||||||
func MonitorResolution() (int, int) {
|
func MonitorResolution() (int, int) {
|
||||||
switch C.XSystemGetDeviceType() {
|
switch C.XSystemGetDeviceType() {
|
||||||
|
case _XSystemDeviceType_Unknown, _XSystemDeviceType_Pc:
|
||||||
|
return 1920, 1080
|
||||||
case _XSystemDeviceType_XboxOne, _XSystemDeviceType_XboxOneS:
|
case _XSystemDeviceType_XboxOne, _XSystemDeviceType_XboxOneS:
|
||||||
return 1920, 1080
|
return 1920, 1080
|
||||||
case _XSystemDeviceType_XboxScarlettLockhart:
|
case _XSystemDeviceType_XboxScarlettLockhart:
|
||||||
@ -70,31 +72,38 @@ func MonitorResolution() (int, int) {
|
|||||||
return 2560, 1440
|
return 2560, 1440
|
||||||
case _XSystemDeviceType_XboxOneX, _XSystemDeviceType_XboxOneXDevkit, _XSystemDeviceType_XboxScarlettAnaconda, _XSystemDeviceType_XboxScarlettDevkit:
|
case _XSystemDeviceType_XboxOneX, _XSystemDeviceType_XboxOneXDevkit, _XSystemDeviceType_XboxScarlettAnaconda, _XSystemDeviceType_XboxScarlettDevkit:
|
||||||
// Series X
|
// Series X
|
||||||
return 3840, 2160
|
fallthrough
|
||||||
default:
|
default:
|
||||||
return 1920, 1080
|
// Forward compatibility.
|
||||||
|
return 3840, 2160
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func D3D12DLLName() string {
|
func D3D12DLLName() string {
|
||||||
switch C.XSystemGetDeviceType() {
|
switch C.XSystemGetDeviceType() {
|
||||||
|
case _XSystemDeviceType_Unknown, _XSystemDeviceType_Pc:
|
||||||
|
return ""
|
||||||
case _XSystemDeviceType_XboxOne, _XSystemDeviceType_XboxOneS, _XSystemDeviceType_XboxOneX, _XSystemDeviceType_XboxOneXDevkit:
|
case _XSystemDeviceType_XboxOne, _XSystemDeviceType_XboxOneS, _XSystemDeviceType_XboxOneX, _XSystemDeviceType_XboxOneXDevkit:
|
||||||
return "d3d12_x.dll"
|
return "d3d12_x.dll"
|
||||||
case _XSystemDeviceType_XboxScarlettLockhart, _XSystemDeviceType_XboxScarlettAnaconda, _XSystemDeviceType_XboxScarlettDevkit:
|
case _XSystemDeviceType_XboxScarlettLockhart, _XSystemDeviceType_XboxScarlettAnaconda, _XSystemDeviceType_XboxScarlettDevkit:
|
||||||
return "d3d12_xs.dll"
|
fallthrough
|
||||||
default:
|
default:
|
||||||
return ""
|
// Forward compatibility.
|
||||||
|
return "d3d12_xs.dll"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func D3D12SDKVersion() uint32 {
|
func D3D12SDKVersion() uint32 {
|
||||||
switch C.XSystemGetDeviceType() {
|
switch C.XSystemGetDeviceType() {
|
||||||
|
case _XSystemDeviceType_Unknown, _XSystemDeviceType_Pc:
|
||||||
|
return 0
|
||||||
case _XSystemDeviceType_XboxOne, _XSystemDeviceType_XboxOneS, _XSystemDeviceType_XboxOneX, _XSystemDeviceType_XboxOneXDevkit:
|
case _XSystemDeviceType_XboxOne, _XSystemDeviceType_XboxOneS, _XSystemDeviceType_XboxOneX, _XSystemDeviceType_XboxOneXDevkit:
|
||||||
return (1 << 16) | 10
|
return (1 << 16) | 10
|
||||||
case _XSystemDeviceType_XboxScarlettLockhart, _XSystemDeviceType_XboxScarlettAnaconda, _XSystemDeviceType_XboxScarlettDevkit:
|
case _XSystemDeviceType_XboxScarlettLockhart, _XSystemDeviceType_XboxScarlettAnaconda, _XSystemDeviceType_XboxScarlettDevkit:
|
||||||
return (2 << 16) | 4
|
fallthrough
|
||||||
default:
|
default:
|
||||||
return 0
|
// Forward compatibility.
|
||||||
|
return (2 << 16) | 4
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user