It 's seems that if you make SDL_surface public you can't access it in subs
I got it like this:
drawtext video, 64, 16, "This 1337 stuff is hot! Hope it got number support :)"
sub drawtext(video as SDL_Surface ptr, x, y, text as string)
dim txtlen as integer
dim charint as integer
dim charrect as SDL_Rect
txtlen = len(text)
for e% = 1 to txtlen
charint = asc(mid$(text,e%,1))
charrect.x = int((x + e%) * 16)
charrect.y = int(y)
if charint > 97 or charint < 122 then
putsprite16 letterspr, video, charrect, charint - 98
end if
if charint > 65 or charint < 90 then
putsprite16 letterspr, video, charrect, charint - 124
end if
next
end sub
sub putsprite16(surfsource as SDL_Surface ptr, video as SDL_Surface ptr, sprpos as SDL_Rect, sprnum)
dim source as SDL_Rect
source.x = int(sprnum * 16)
source.y = 0
source.w = 16
source.h = 16
SDL_BlitSurface surfsource, varptr(source), video, varptr(sprpos)
end sub
I dont know if it's a bug