Compare commits
3 commits
Author | SHA1 | Date | |
---|---|---|---|
|
048bed085f | ||
|
799c008c52 | ||
|
98be679ce2 |
3 changed files with 18 additions and 17 deletions
|
@ -2,6 +2,12 @@
|
||||||
### This is a basic utility to toggle the DLSS indicator overlay as described in [this arcticle](https://www.pcgamer.com/nvidia-dlss-indicator/)
|
### This is a basic utility to toggle the DLSS indicator overlay as described in [this arcticle](https://www.pcgamer.com/nvidia-dlss-indicator/)
|
||||||
|
|
||||||
|
|
||||||
|
#### How to use:
|
||||||
|
|
||||||
|
Grab the latest release from [here](https://github.com/Watn3y/DLSS-indicator-toggle/releases/latest/download/DLSS_indicator_toggle.exe) and run it.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#### How to build:
|
#### How to build:
|
||||||
- Embed the manifest inside your binary
|
- Embed the manifest inside your binary
|
||||||
|
|
||||||
|
|
7
main.go
7
main.go
|
@ -24,7 +24,7 @@ func main() {
|
||||||
Layout: VBox{},
|
Layout: VBox{},
|
||||||
Children: []Widget{
|
Children: []Widget{
|
||||||
TextLabel{
|
TextLabel{
|
||||||
Text: "The DLSS Indicator is currently",
|
Text: "The DLSS Indicator status:",
|
||||||
TextAlignment: AlignHCenterVCenter,
|
TextAlignment: AlignHCenterVCenter,
|
||||||
},
|
},
|
||||||
TextLabel{
|
TextLabel{
|
||||||
|
@ -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 {
|
||||||
setKeyOff()
|
setKey(0)
|
||||||
} else {
|
} else {
|
||||||
setKeyOn()
|
setKey(1024)
|
||||||
}
|
}
|
||||||
getKey()
|
getKey()
|
||||||
indicatorTextLabel.SetText(indicatorStatusString)
|
indicatorTextLabel.SetText(indicatorStatusString)
|
||||||
|
|
22
reg.go
22
reg.go
|
@ -5,8 +5,11 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func getKey() {
|
func getKey() {
|
||||||
key, _ := 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 {
|
||||||
|
indicatorStatusString = "Error: DLSS not supported or registry path not accessible"
|
||||||
|
return
|
||||||
|
}
|
||||||
value, _, _ := key.GetIntegerValue("ShowDlssIndicator")
|
value, _, _ := key.GetIntegerValue("ShowDlssIndicator")
|
||||||
defer key.Close()
|
defer key.Close()
|
||||||
|
|
||||||
|
@ -20,18 +23,9 @@ func getKey() {
|
||||||
indicatorStatusString = "NOT SET"
|
indicatorStatusString = "NOT SET"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
func setKeyOn() {
|
|
||||||
|
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))
|
||||||
key.SetDWordValue("ShowDlssIndicator", uint32(1024))
|
|
||||||
defer key.Close()
|
defer key.Close()
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
func setKeyOff() {
|
|
||||||
key, _ := registry.OpenKey(registry.LOCAL_MACHINE, `SOFTWARE\NVIDIA Corporation\Global\NGXCore`, registry.SET_VALUE)
|
|
||||||
|
|
||||||
key.SetDWordValue("ShowDlssIndicator", uint32(0))
|
|
||||||
defer key.Close()
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue