mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08:54 +01:00
internal/glfwwin: refactoring: reduce risky unsafe.Pointer usages
This commit is contained in:
parent
0d7062335e
commit
604f14d2d4
@ -30,9 +30,8 @@ import (
|
|||||||
"golang.org/x/sys/windows"
|
"golang.org/x/sys/windows"
|
||||||
)
|
)
|
||||||
|
|
||||||
func monitorCallback(handle _HMONITOR, dc _HDC, rect *_RECT, data _LPARAM) uintptr /* _BOOL */ {
|
func monitorCallback(handle _HMONITOR, dc _HDC, rect *_RECT, monitor *Monitor /* _LPARAM */) uintptr /* _BOOL */ {
|
||||||
if mi, ok := _GetMonitorInfoW_Ex(handle); ok {
|
if mi, ok := _GetMonitorInfoW_Ex(handle); ok {
|
||||||
monitor := (*Monitor)(unsafe.Pointer(data))
|
|
||||||
if windows.UTF16ToString(mi.szDevice[:]) == monitor.win32.adapterName {
|
if windows.UTF16ToString(mi.szDevice[:]) == monitor.win32.adapterName {
|
||||||
monitor.win32.handle = handle
|
monitor.win32.handle = handle
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user