     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)
+    var textureRect = SDL_Rect(x: offsetLeft + (Int32(x) * cellWidth),
+        y: offsetTop + ny, w: surface.memory.w, h: surface.memory.h)
     SDL_RenderCopy(renderer, texture, nil, &textureRect)
     x += string.characters.count
+  }
+
+  func changeScreenSize(width: Int32, height: Int32) {
+    self.width = Int((width - offsetLeft) / cellWidth)
+    self.height = Int((height - offsetTop) / cellHeight)
   }
 
 }

    }
  }
  if invalidated {
    SDL_SetRenderDrawColor(rend, 255, 255, 255, 255)
    SDL_RenderClear(rend)
    let msgResult = SDL_RenderCopy(rend, msg, nil, &msgRect)

//   SDL_Delay(16)
}

p("about to quit")
