summaryrefslogtreecommitdiff
path: root/menuApp
diff options
context:
space:
mode:
Diffstat (limited to 'menuApp')
-rw-r--r--menuApp/src/main.cpp6
-rw-r--r--menuApp/src/ofApp.cpp22
2 files changed, 24 insertions, 4 deletions
diff --git a/menuApp/src/main.cpp b/menuApp/src/main.cpp
index 3c31279..733814a 100644
--- a/menuApp/src/main.cpp
+++ b/menuApp/src/main.cpp
@@ -3,8 +3,10 @@
//========================================================================
int main( ){
- int width=(1920*FACTOR*sin(ROTATION))+(1080*FACTOR*cos(ROTATION));
- int height=(1920*FACTOR*cos(ROTATION))+(1080*FACTOR*sin(ROTATION));
+ float rotation=ofDegToRad(ROTATION);
+ int width=(1920*FACTOR*sin(rotation))+(1080*FACTOR*cos(rotation));
+ int height=(1920*FACTOR*cos(rotation))+(1080*FACTOR*sin(rotation));
+
#ifdef FULLSCREEN
ofSetupOpenGL(width,height,OF_FULLSCREEN);
#else
diff --git a/menuApp/src/ofApp.cpp b/menuApp/src/ofApp.cpp
index ce141de..81350ac 100644
--- a/menuApp/src/ofApp.cpp
+++ b/menuApp/src/ofApp.cpp
@@ -186,6 +186,14 @@ void ofApp::draw(){
loadInstagramFeed();
}
+ofPushMatrix();
+
+ if(ROTATION>0){
+ ofTranslate(540*FACTOR,960*FACTOR);
+ ofRotate(-ROTATION);
+ ofTranslate(-120*FACTOR,-540*FACTOR);
+ }
+
ofPushMatrix(); //Store the coordinate system nexessary for some reason
background.draw(0,0,1080*FACTOR,1920*FACTOR); //ofGetWidth(),ofGetHeight());
ofPopMatrix(); //Restore the coordinate system
@@ -242,7 +250,17 @@ ofPopMatrix(); //Restore the coordinate system
//hence the "primed" mechanism
if (primed){
ofImage img;
- img.grabScreen(0, 0,1080*FACTOR,1920*FACTOR);
+ //float rotation=ofDegToRad(ROTATION);
+ //int width=(1920*FACTOR*sin(rotation))+(1080*FACTOR*cos(rotation));
+ //int height=(1920*FACTOR*cos(rotation))+(1080*FACTOR*sin(rotation));
+ img.grabScreen(0, 0,1920*FACTOR,1920*FACTOR);
+ if(ROTATION>0){
+ img.rotate90(1);
+ img.crop(860*FACTOR,0,1080*FACTOR,1920*FACTOR);
+ }
+ else {
+ img.crop(0,0,1080*FACTOR,1920*FACTOR);
+ }
img.save(SCREENGRABFILEPATH);
primed=false;
}
@@ -252,7 +270,7 @@ ofPopMatrix(); //Restore the coordinate system
isGrabbed=true;
}
-
+ofPopMatrix();
}