Handle no DLSS support error #1
2 changed files with 5 additions and 4 deletions
3
main.go
3
main.go
|
@ -37,10 +37,11 @@ func main() {
|
||||||
Text: "Toggle Indicator",
|
Text: "Toggle Indicator",
|
||||||
|
|
||||||
OnClicked: func() {
|
OnClicked: func() {
|
||||||
|
// a value of 1024 activates the overlay, a value of 0 deactivates it. Other values seem to deactivate it as well but you never know
|
||||||
if indicatorStatus == 1024 {
|
if indicatorStatus == 1024 {
|
||||||
setKey(0)
|
setKey(0)
|
||||||
} else {
|
} else {
|
||||||
setKey(1)
|
setKey(1024)
|
||||||
}
|
}
|
||||||
getKey()
|
getKey()
|
||||||
indicatorTextLabel.SetText(indicatorStatusString)
|
indicatorTextLabel.SetText(indicatorStatusString)
|
||||||
|
|
4
reg.go
4
reg.go
|
@ -7,7 +7,7 @@ import (
|
||||||
func getKey() {
|
func getKey() {
|
||||||
key, err := registry.OpenKey(registry.LOCAL_MACHINE, `SOFTWARE\NVIDIA Corporation\Global\NGXCore`, registry.QUERY_VALUE)
|
key, err := registry.OpenKey(registry.LOCAL_MACHINE, `SOFTWARE\NVIDIA Corporation\Global\NGXCore`, registry.QUERY_VALUE)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
indicatorStatusString = "Error: DLSS not supported!"
|
indicatorStatusString = "Error: DLSS not supported or registry path not accessible"
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
value, _, _ := key.GetIntegerValue("ShowDlssIndicator")
|
value, _, _ := key.GetIntegerValue("ShowDlssIndicator")
|
||||||
|
@ -26,6 +26,6 @@ func getKey() {
|
||||||
|
|
||||||
func setKey(value int) {
|
func setKey(value int) {
|
||||||
key, _ := registry.OpenKey(registry.LOCAL_MACHINE, `SOFTWARE\NVIDIA Corporation\Global\NGXCore`, registry.SET_VALUE)
|
key, _ := registry.OpenKey(registry.LOCAL_MACHINE, `SOFTWARE\NVIDIA Corporation\Global\NGXCore`, registry.SET_VALUE)
|
||||||
key.SetDWordValue("ShowDlssIndicator", uint32(value * 1024))
|
key.SetDWordValue("ShowDlssIndicator", uint32(value))
|
||||||
defer key.Close()
|
defer key.Close()
|
||||||
}
|
}
|
Loading…
Reference in a new issue