Made width & height required parameters for NewDisplay.
This commit is contained in:
parent
e8ff8c35fe
commit
ca64417bb8
@ -23,7 +23,7 @@ type NewDisplayOptions struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// NewDisplay creates a display
|
// NewDisplay creates a display
|
||||||
func NewDisplay(options NewDisplayOptions) (*Display, error) {
|
func NewDisplay(width, height int, options NewDisplayOptions) (*Display, error) {
|
||||||
var flags C.int = C.ALLEGRO_WINDOWED
|
var flags C.int = C.ALLEGRO_WINDOWED
|
||||||
if options.Fullscreen {
|
if options.Fullscreen {
|
||||||
if options.Windowed {
|
if options.Windowed {
|
||||||
@ -39,7 +39,7 @@ func NewDisplay(options NewDisplayOptions) (*Display, error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
C.al_set_new_display_flags(flags)
|
C.al_set_new_display_flags(flags)
|
||||||
d := C.al_create_display(C.int(options.Width), C.int(options.Height))
|
d := C.al_create_display(C.int(width), C.int(height))
|
||||||
if nil == d {
|
if nil == d {
|
||||||
return nil, fmt.Errorf("Error creating display")
|
return nil, fmt.Errorf("Error creating display")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user