feat: Add option to select card

Closes #1
This commit is contained in:
ptrcnull 2021-12-05 04:55:29 +01:00
parent e260768039
commit 3d227d6fbe

4
drm.go
View file

@ -26,8 +26,8 @@ type Display struct {
savedCrtc *mode.Crtc savedCrtc *mode.Crtc
} }
func NewImage() (*Image, error) { func NewImage(card int) (*Image, error) {
file, err := drm.OpenCard(0) file, err := drm.OpenCard(card)
if err != nil { if err != nil {
return nil, fmt.Errorf("open drm card: %w", err) return nil, fmt.Errorf("open drm card: %w", err)
} }