Re: SDL TTF 3 Issue
- Posted by ghaberek (admin) 2 weeks ago
- 451 views
Icy_Viking said...
Thank you, it works! I think it was the pointers that were throwing me off.
I typically wrap "get" functions so the user doesn't have to deal with passing pointers. They can just call the function and get the results in a sequence.
public function SDL_GetTextureSize(atom texture) atom x = 0, y = 0 atom px = allocate_data(sizeof(C_FLOAT)) atom py = allocate_data(sizeof(C_FLOAT)) if c_func(xSDL_GetTextureSize, {texture,px,py}) then x = peek_type(px, C_FLOAT) y = peek_type(py, C_FLOAT) end if free(py) free(px) return {x,y} end function
-Greg