mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-27 19:22:49 +01:00
internal/graphicsdriver/opengl: refactoring
This commit is contained in:
parent
4be626f707
commit
b6d539d8e8
@ -43,19 +43,19 @@ func isGLXExtensionForGL2Available() bool {
|
|||||||
var listingExtensions bool
|
var listingExtensions bool
|
||||||
s := bufio.NewScanner(&buf)
|
s := bufio.NewScanner(&buf)
|
||||||
for s.Scan() {
|
for s.Scan() {
|
||||||
|
line := s.Text()
|
||||||
if !listingExtensions {
|
if !listingExtensions {
|
||||||
if s.Text() == "GLX extensions:" {
|
if line == "GLX extensions:" {
|
||||||
listingExtensions = true
|
listingExtensions = true
|
||||||
}
|
}
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
if !strings.HasPrefix(s.Text(), indent) {
|
if !strings.HasPrefix(line, indent) {
|
||||||
listingExtensions = false
|
listingExtensions = false
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
line := s.Text()
|
|
||||||
for len(line) > 0 {
|
for len(line) > 0 {
|
||||||
head, tail, _ := strings.Cut(line, ",")
|
head, tail, _ := strings.Cut(line, ",")
|
||||||
if strings.TrimSpace(head) == ext {
|
if strings.TrimSpace(head) == ext {
|
||||||
|
Loading…
Reference in New Issue
Block a user