internal/graphicsdriver/opengl: refactoring

This commit is contained in:
Hajime Hoshi 2024-11-07 13:25:26 +09:00
parent 4be626f707
commit b6d539d8e8

View File

@ -43,19 +43,19 @@ func isGLXExtensionForGL2Available() bool {
var listingExtensions bool
s := bufio.NewScanner(&buf)
for s.Scan() {
line := s.Text()
if !listingExtensions {
if s.Text() == "GLX extensions:" {
if line == "GLX extensions:" {
listingExtensions = true
}
continue
}
if !strings.HasPrefix(s.Text(), indent) {
if !strings.HasPrefix(line, indent) {
listingExtensions = false
break
}
line := s.Text()
for len(line) > 0 {
head, tail, _ := strings.Cut(line, ",")
if strings.TrimSpace(head) == ext {