Closed Gleefre closed 10 months ago
There is a problem: WIDTH
and HEIGHT
bindings might be expressions depending on other variables, and thus can be set only during the PREPARE
method call. But that would be too late, since the window would be already created.
It seems that PREPARE
doesn't depend on the window being created (and the sketch's environment being initialized), so it seems possible to transform it into an initialize-instance :around
method that calculates slots values before calling next method and set them after. It should also pass :w
and :h
arguments to create the window with given width/height avoiding the resize.
Completes https://github.com/vydd/sketch/issues/25. Fixes https://github.com/vydd/sketch/issues/69.
It adds
:default-initargs
to the class definition generated bydefsketch
and uses them to set:w
and:h
initargs in theinitialize-instance :around
method. Those are used insdl2:create-window
bykit.sdl2
.Thus the window
:x
or:y
are specified).