From e1f18b53f5d8d34fe98cb6e24f7d902541bc9fd4 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Mon, 16 Oct 2023 00:02:25 +0900 Subject: [PATCH] internal/ui: refactoring --- internal/ui/graphics.go | 9 --------- 1 file changed, 9 deletions(-) diff --git a/internal/ui/graphics.go b/internal/ui/graphics.go index 9a23c1a20..1f24ea83e 100644 --- a/internal/ui/graphics.go +++ b/internal/ui/graphics.go @@ -67,27 +67,18 @@ func newGraphicsDriver(creator graphicsDriverCreator, graphicsLibrary GraphicsLi if err != nil { return nil, 0, err } - if g == nil { - return nil, 0, fmt.Errorf("ui: %s is specified but OpenGL is not available", graphicsLibrary) - } return g, GraphicsLibraryOpenGL, nil case GraphicsLibraryDirectX: g, err := creator.newDirectX() if err != nil { return nil, 0, err } - if g == nil { - return nil, 0, fmt.Errorf("ui: %s is specified but DirectX is not available.", graphicsLibrary) - } return g, GraphicsLibraryDirectX, nil case GraphicsLibraryMetal: g, err := creator.newMetal() if err != nil { return nil, 0, err } - if g == nil { - return nil, 0, fmt.Errorf("ui: %s is specified but Metal is not available", graphicsLibrary) - } return g, GraphicsLibraryMetal, nil default: return nil, 0, fmt.Errorf("ui: an unsupported graphics library is specified: %d", graphicsLibrary)