summaryrefslogtreecommitdiff
path: root/menuApp/src
diff options
context:
space:
mode:
authortim <tim@eclectronics.org>2017-06-12 21:33:35 +0100
committertim <tim@eclectronics.org>2017-06-12 21:33:35 +0100
commitb2e4d58259d8e4ca744d40ad53bb3ca5e3d0ed3d (patch)
tree9227ac74c9007046b851bed615f3ea696b061db6 /menuApp/src
parentb0b210ea989577495e24e34a171d564ba13b4ddb (diff)
avoid crash with too few items
Diffstat (limited to 'menuApp/src')
-rw-r--r--menuApp/src/main.cpp7
-rw-r--r--menuApp/src/ofApp.cpp6
2 files changed, 7 insertions, 6 deletions
diff --git a/menuApp/src/main.cpp b/menuApp/src/main.cpp
index e0837f0..3c31279 100644
--- a/menuApp/src/main.cpp
+++ b/menuApp/src/main.cpp
@@ -3,11 +3,12 @@
//========================================================================
int main( ){
-
+ int width=(1920*FACTOR*sin(ROTATION))+(1080*FACTOR*cos(ROTATION));
+ int height=(1920*FACTOR*cos(ROTATION))+(1080*FACTOR*sin(ROTATION));
#ifdef FULLSCREEN
- ofSetupOpenGL(1080*FACTOR, 1920*FACTOR,OF_FULLSCREEN);
+ ofSetupOpenGL(width,height,OF_FULLSCREEN);
#else
- ofSetupOpenGL(1080*FACTOR, 1920*FACTOR,OF_WINDOW); // <-------- setup the GL context
+ ofSetupOpenGL(width,height,OF_WINDOW);
#endif
// this kicks off the running of my app
// can be OF_WINDOW or OF_FULLSCREEN
diff --git a/menuApp/src/ofApp.cpp b/menuApp/src/ofApp.cpp
index 8dbf41b..ce141de 100644
--- a/menuApp/src/ofApp.cpp
+++ b/menuApp/src/ofApp.cpp
@@ -29,7 +29,7 @@ bool ofApp::loadInstagramFeed(){
}
*/
items.clear();
- items.resize(IMAGE_SLOTS);
+ //items.resize(IMAGE_SLOTS);
instagram.getUserRecentMedia("self");
//instagram.getUserLikedMedia(12);
@@ -87,7 +87,7 @@ bool ofApp::loadInstagramFeed(){
if (interesting){
- items[slot]=menuItem(caption,price);
+ items.push_back(menuItem(caption,price));
//items[slot]=menuItem(test[i],price);
std::string id=instagram.getImageID()[i];
@@ -137,7 +137,7 @@ void ofApp::setup(){
ofLog(OF_LOG_NOTICE) << "code for € is " << ((int)str.at(0)) << " not " << 0xA4;
ofLog(OF_LOG_NOTICE) << "-30 as uint8_t is " << ((int)((uint8_t)-30));
*/
- items.resize(IMAGE_SLOTS);
+ //items.resize(IMAGE_SLOTS);
ofTrueTypeFont::setGlobalDpi(150);