The function was `LoadWEBPAnimation_RW` from sdl2_image. I need to
iterate through the `frames` field in the `IMG_Animation` struct,
which is `**SDL_Surface` and convert it to texture for later on to be
rendered.
I think the problem is solved. C's `**opaque` (array of pointers)
translates to `*[*]*opaque` instead of `[*]opaque`. Although I haven't
try my actual code.
B
Re: question how to create and interact with C's array of pointers
Quoth Abdul Wahab:
>The function was `LoadWEBPAnimation_RW` from sdl2_image. I need to>iterate through the `frames` field in the `IMG_Animation` struct,>which is `**SDL_Surface` and convert it to texture for later on to be>rendered.>I think the problem is solved. C's `**opaque` (array of pointers)>translates to `*[*]*opaque` instead of `[*]opaque`. Although I haven't>try my actual code.>B
Note that in C, a pointer to void is incompatible with a pointer
to SDL_Surface. For example, a pointer to void may be larger than
a pointer to SDL_Surface. For you, that means that it’d be better
to represent a C SDL_Surface** not as *[*]*opaque in Hare, but as
*[*]*SDL_Surface with a definition of SDL_Surface that is
compatible to C’s SDL_Surface.
Re: question how to create and interact with C's array of pointers
IMG_Animations have a count along with the **SDL_Surface, so if you want
you can make a types::slice with data set to the **SDL_Surface and
length and cap set to the count, then cast to []*SDL_Surface. Then you
get bounds checking.