From: Javier Sancho Date: Sat, 23 May 2020 18:27:09 +0000 (+0200) Subject: check video driver creation X-Git-Url: https://git.jsancho.org/?a=commitdiff_plain;h=b0ddab5e24e62ec21a3a8fcd74cb34791441d6f1;p=guile-irrlicht.git check video driver creation --- diff --git a/irrlicht/device.scm b/irrlicht/device.scm index e5eac5a..2035932 100644 --- a/irrlicht/device.scm +++ b/irrlicht/device.scm @@ -45,10 +45,9 @@ (let* ((createDevice (get-irrlicht-proc "createDevice")) (device (createDevice device-type window-size bits fullscreen stencilbuffer vsync receiver))) - (cond ((null-object? device) - (error "In procedure create-device: Device cannot be created")) - (else - device)))) + (if (null-object? device) + (error "In procedure create-device: Device cannot be created") + device))) (define-method (get-cursor-control (device )) (let ((getCursorControl (get-irrlicht-proc "getCursorControl" device))) @@ -71,8 +70,11 @@ (getTimer device))) (define-method (get-video-driver (device )) - (let ((getVideoDriver (get-irrlicht-proc "getVideoDriver" device))) - (getVideoDriver device))) + (let* ((getVideoDriver (get-irrlicht-proc "getVideoDriver" device)) + (driver (getVideoDriver device))) + (if (null-object? driver) + (error "In procedure get-video-driver: Driver cannot be created") + driver))) (define-method (is-window-active? (device )) (let ((isWindowActive (get-irrlicht-proc "isWindowActive" device)))