Re: SDL TTF 3 Issue

new topic     » goto parent     » topic index » view thread      » older message » newer message
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

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu