 while !done {
   while SDL_PollEvent(&ev) != 0 {
     invalidated = true
-    //p("event \(ev.type)")
     if ev.type == SDL.TEXTINPUT {
       p("text input \(ev.text)")
     } else if ev.type == SDL.QUIT {


let textGrid = TextGrid(renderer: rend, font: freeSans)

var sizeWidth: Int32 = 0
var sizeHeight: Int32 = 0

TTF_SizeUNICODE(freeSans, Array("Coração".utf16), &sizeWidth, &sizeHeight)

p("size width \(sizeWidth) height \(sizeHeight)")

p("font height \(TTF_FontHeight(freeSans))")

p("font ascent \(TTF_FontAscent(freeSans)) descent \(TTF_FontDescent(freeSans))")

p("font line skip \(TTF_FontLineSkip(freeSans))")

let fontColor = SDL_Color(r: 0, g: 0, b: 255, a: 255)

let shadowColor = SDL_Color(r: 0, g: 0, b: 0, a: 255)

// Blended version does anti-aliasing, finally!
//let surfaceMsg = TTF_RenderText_Blended(freeSans, "Hello World!", fontColor)
let surfaceMsg = TTF_RenderUTF8_Blended(freeSans, "Hello ção World!", fontColor)
// let surfaceMsg = TTF_RenderText_Shaded(freeSans, "Hello ção World!", fontColor,
//     shadowColor)
//let surfaceMsg = TTF_RenderText_Solid(freeSans, "Hello World!", fontColor)

// SDL_SaveBMP_RW(surfaceMsg, SDL_RWFromFile("/home/dewd/t_/hello_sdl.bmp", "wb"), 1)

let msg = SDL_CreateTextureFromSurface(rend, surfaceMsg)

SDL_FreeSurface(surfaceMsg)

let textWidth = surfaceMsg.memory.w
let textHeight = surfaceMsg.memory.h

var msgRect = SDL_Rect(x: 10, y: 10, w: textWidth, h: textHeight)

// let msgResult = SDL_RenderCopy(rend, msg, nil, &msgRect)

//SDL_DestroyTexture(msg)

// p("msgResult \(msgResult)")

p("surfaceMsg \(surfaceMsg)")

p("font \(freeSans)")

let redColor = SDL_Color(r: 255, g: 0, b: 0, a: 255)
let blackColor = SDL_Color(r: 0, g: 0, b: 0, a: 255)
let yellowColor = SDL_Color(r: 255, g: 255, b: 0, a: 255)

func drawAgain() {
  textGrid.move(1, y: 10)
  textGrid.add("Leo")
  textGrid.add("nardo")

    self.renderer = renderer
    self.font = font
    cellHeight = TTF_FontHeight(font)
    TTF_GlyphMetrics(font, 65, nil, nil, nil, nil, &cellWidth)
  }

  func move(x: Int, y: Int) {
