 var ev = SDL_Event()
 var done = false
 var invalidated = false
+var lastWidth: Int32 = -1
+var lastHeight: Int32 = -1
 
 while !done {
   while SDL_PollEvent(&ev) != 0 {
     invalidated = true
-    p("event \(ev.type)")
+    //p("event \(ev.type)")
     if ev.type == SDL.TEXTINPUT {
       p("text input \(ev.text)")
     } else if ev.type == SDL.QUIT {

    defer { SDL_FreeSurface(surface) }
    let texture = SDL_CreateTextureFromSurface(renderer, surface)
    defer { SDL_DestroyTexture(texture) }
    var textureRect = SDL_Rect(x: Int32(x) * cellWidth, y: ny,
        w: surface.memory.w, h: surface.memory.h)
    SDL_RenderCopy(renderer, texture, nil, &textureRect)
    x += string.characters.count
  }

}

//   SDL_Delay(16)
}

p("about to quit")
