Skip to content

Conversation

@jwoertink
Copy link
Contributor

This fixes the missing overload error:

Overloads are:
 - SDL::Surface#fill(rect, r, g, b, a = nil)

  window.surface.fill(255, 255, 255)

@ysbaddaden
Copy link
Owner

But, Surface#fill(r, g, b, a) exists. I guess the compiler can't find it, and the #fill(rect, r, g, b, a) should be modified like so rect : Rect?

@jwoertink
Copy link
Contributor Author

jwoertink commented Sep 17, 2017

I think it doesn't catch that one because of these two lines calling the pointerof(rect). In this case, rect can't be nil, which, it would be in the Surface#fill(r, g, b, a).

in src/surface.cr:125: argument 'rect' of 'LibSDL#fill_rect' must be Pointer(SDL::Rect), not Pointer(Nil)

        LibSDL.fill_rect(self, pointerof(rect), color(r, g, b))

Unless that's a whole separate issue? What if I just add a default SDL::Rect to this line instead of passing nil. It would be SDL::Rect[0, 0, width, height]

…d underlying issue with overload to use a default rect that fills the entire surface. Tested all samples to ensure they all still work.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants