derive from GLKViewController

this handles resizing the view/framebuffer much better

fixes #130, #131, #133, #118
This commit is contained in:
Konstantin Käfer
2014-04-14 18:48:11 -04:00
parent 305e688a3a
commit f18aa61e33
13 changed files with 216 additions and 216 deletions

View File

@@ -44,16 +44,14 @@ void Map::loadSettings() {
update();
}
void Map::resize(uint16_t width, uint16_t height, uint16_t fb_width, uint16_t fb_height) {
transform.resize(width, height, fb_width, fb_height);
void Map::resize(uint16_t width, uint16_t height, float ratio, uint16_t fb_width, uint16_t fb_height) {
transform.resize(width, height, ratio, fb_width, fb_height);
painter.resize();
if (!style.sprite || style.sprite->pixelRatio != transform.getPixelRatio()) {
style.sprite = std::make_shared<Sprite>(transform.getPixelRatio());
style.sprite->load(kSpriteURL);
}
update();
}
void Map::toggleRaster() {
@@ -479,5 +477,9 @@ bool Map::render() {
painter.renderMatte();
return changed || transform.needsAnimation() || painter.needsAnimation();
bool transition = transform.needsAnimation();
bool animation = painter.needsAnimation();
return changed || transition || animation;
}