From 7641fad8ebc4ba0e6412fcb7a556a705c0a6ea2c Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Thu, 5 Jan 2012 00:02:13 +0000 Subject: viewport objectified --- map4.xcodeproj/tim.mode1v3 | 130 +++++++++++++++++--------- map4.xcodeproj/tim.pbxuser | 226 ++++++++++++++++++++++----------------------- src/main.cpp | 2 +- src/testApp.cpp | 30 ++++-- src/testApp.h | 1 + src/viewpoint.cpp | 10 +- 6 files changed, 224 insertions(+), 175 deletions(-) diff --git a/map4.xcodeproj/tim.mode1v3 b/map4.xcodeproj/tim.mode1v3 index df4c30e..d42c04d 100644 --- a/map4.xcodeproj/tim.mode1v3 +++ b/map4.xcodeproj/tim.mode1v3 @@ -197,7 +197,48 @@ Notifications OpenEditors - + + + Content + + PBXProjectModuleGUID + 226875DB14B51C4B006FAF1F + PBXProjectModuleLabel + ofRectangle.h + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 226875DC14B51C4B006FAF1F + PBXProjectModuleLabel + ofRectangle.h + _historyCapacity + 0 + bookmark + 226875DD14B51C4B006FAF1F + history + + 226875D014B51C34006FAF1F + + + SplitCount + 1 + + StatusBarVisibility + + + Geometry + + Frame + {{0, 20}, {976, 477}} + PBXModuleWindowStatusBarHidden2 + + RubberWindowFrame + 15 60 976 518 0 0 1024 578 + + + PerspectiveWidths -1 @@ -271,7 +312,7 @@ PBXSmartGroupTreeModuleOutlineStateSelectionKey - 11 + 8 3 0 @@ -314,7 +355,7 @@ PBXProjectModuleGUID 1CE0B20306471E060097A5F4 PBXProjectModuleLabel - testApp.cpp + viewpoint.cpp PBXSplitModuleInNavigatorKey Split0 @@ -322,28 +363,29 @@ PBXProjectModuleGUID 1CE0B20406471E060097A5F4 PBXProjectModuleLabel - testApp.cpp + viewpoint.cpp _historyCapacity 0 bookmark - 226875A614B5000F006FAF1F + 226875DA14B51C4B006FAF1F history 220EA1EF14925D45004424ED 22AFFECF149798EE0079DDC5 22AFFED1149798EE0079DDC5 22570F8114B111F1009BC2A4 - 22570F8214B111F1009BC2A4 2257104214B1404F009BC2A4 2257104414B1404F009BC2A4 - 22578A0914B34BAC0036E99C - 2226A43014B3B80600A9FC9F 2226A46F14B3BF5C00A9FC9F - 2226A47914B3C58400A9FC9F 2226A47A14B3C58400A9FC9F 2226A47C14B3C58400A9FC9F - 2226A4A514B3CAB700A9FC9F - 22D4C35D14B4FAF600BC7337 + 226875D314B51C4B006FAF1F + 226875D414B51C4B006FAF1F + 226875D514B51C4B006FAF1F + 226875D614B51C4B006FAF1F + 226875D714B51C4B006FAF1F + 226875D814B51C4B006FAF1F + 226875D914B51C4B006FAF1F SplitCount @@ -541,8 +583,14 @@ 5 WindowOrderList + 226875E714B51C4B006FAF1F + 226875E814B51C4B006FAF1F + 1C78EAAD065D492600B07095 + 1CD10A99069EF8BA00B06720 22C080D114918C2F00E6B4C0 /Developer/Library/openFrameworks/custom/dev/map4/map4.xcodeproj + 1C530D57069F1CE1000CFCEE + 226875DB14B51C4B006FAF1F WindowString 0 59 1024 519 0 0 1024 578 @@ -744,13 +792,13 @@ TableOfContents 1CD10A99069EF8BA00B06720 - 22D4C34C14B4F03D00BC7337 + 226875DE14B51C4B006FAF1F 1C162984064C10D400B95A72 - 22D4C34D14B4F03D00BC7337 - 22D4C34E14B4F03D00BC7337 - 22D4C34F14B4F03D00BC7337 - 22D4C35014B4F03D00BC7337 - 22D4C35114B4F03D00BC7337 + 226875DF14B51C4B006FAF1F + 226875E014B51C4B006FAF1F + 226875E114B51C4B006FAF1F + 226875E214B51C4B006FAF1F + 226875E314B51C4B006FAF1F ToolbarConfiguration xcode.toolbar.config.debugV3 @@ -762,8 +810,12 @@ + FirstTimeWindowDisplayed + Identifier windowTool.find + IsVertical + Layout @@ -778,26 +830,16 @@ PBXProjectModuleGUID 1CDD528C0622207200134675 PBXProjectModuleLabel - <No Editor> - PBXSplitModuleInNavigatorKey - - Split0 - - PBXProjectModuleGUID - 1CD0528D0623707200166675 - - SplitCount - 1 - + ofRectangle.h StatusBarVisibility - 1 + GeometryConfiguration Frame - {{0, 0}, {781, 167}} + {{0, 0}, {781, 212}} RubberWindowFrame - 62 385 781 470 0 0 1440 878 + 21 85 781 470 0 0 1024 578 Module PBXNavigatorGroup @@ -806,11 +848,11 @@ Proportion - 50% + 212pt BecomeActive - 1 + ContentConfiguration PBXProjectModuleGUID @@ -821,18 +863,18 @@ GeometryConfiguration Frame - {{8, 0}, {773, 254}} + {{0, 217}, {781, 212}} RubberWindowFrame - 62 385 781 470 0 0 1440 878 + 21 85 781 470 0 0 1024 578 Module PBXProjectFindModule Proportion - 50% + 212pt Proportion - 428pt + 429pt Name @@ -842,23 +884,21 @@ PBXProjectFindModule StatusbarIsVisible - 1 + TableOfContents 1C530D57069F1CE1000CFCEE - 1C530D58069F1CE1000CFCEE - 1C530D59069F1CE1000CFCEE + 226875E414B51C4B006FAF1F + 226875E514B51C4B006FAF1F 1CDD528C0622207200134675 - 1C530D5A069F1CE1000CFCEE - 1CE0B1FE06471DED0097A5F4 1CD0528E0623707200166675 WindowString - 62 385 781 470 0 0 1440 878 + 21 85 781 470 0 0 1024 578 WindowToolGUID 1C530D57069F1CE1000CFCEE WindowToolIsVisible - 0 + Identifier @@ -912,7 +952,7 @@ TableOfContents 1C78EAAD065D492600B07095 - 22D4C35214B4F03D00BC7337 + 226875E614B51C4B006FAF1F 1C78EAAC065D492600B07095 ToolbarConfiguration diff --git a/map4.xcodeproj/tim.pbxuser b/map4.xcodeproj/tim.pbxuser index 82ec3ca..b0d5bf8 100644 --- a/map4.xcodeproj/tim.pbxuser +++ b/map4.xcodeproj/tim.pbxuser @@ -47,16 +47,6 @@ sourceDirectories = ( ); }; - 2226A43014B3B80600A9FC9F /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 22EF433814AF89EF003C3497 /* mapUtils.cpp */; - name = "mapUtils.cpp: 11"; - rLen = 0; - rLoc = 171; - rType = 0; - vrLen = 1475; - vrLoc = 2715; - }; 2226A46F14B3BF5C00A9FC9F /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = E4B69E1F0A3A1BDC003C02F2 /* testApp.h */; @@ -67,16 +57,6 @@ vrLen = 629; vrLoc = 649; }; - 2226A47914B3C58400A9FC9F /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 223429A414AF70B100D0B406 /* viewpoint.h */; - name = "viewpoint.h: 43"; - rLen = 0; - rLoc = 681; - rType = 0; - vrLen = 526; - vrLoc = 175; - }; 2226A47A14B3C58400A9FC9F /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = 2226A47B14B3C58400A9FC9F /* ofLight.h */; @@ -104,26 +84,6 @@ vrLen = 858; vrLoc = 1618; }; - 2226A4A514B3CAB700A9FC9F /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 223429A314AF70B100D0B406 /* viewpoint.cpp */; - name = "viewpoint.cpp: 34"; - rLen = 0; - rLoc = 651; - rType = 0; - vrLen = 835; - vrLoc = 0; - }; - 2226A4AB14B3CAEB00A9FC9F /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = E4B69E1E0A3A1BDC003C02F2 /* testApp.cpp */; - name = "testApp.cpp: 14"; - rLen = 0; - rLoc = 255; - rType = 0; - vrLen = 741; - vrLoc = 0; - }; 223429A114AF70B100D0B406 /* keyVar.cpp */ = { uiCtxt = { sepNavIntBoundsRect = "{{0, 0}, {755, 715}}"; @@ -140,17 +100,17 @@ }; 223429A314AF70B100D0B406 /* viewpoint.cpp */ = { uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {1076, 1235}}"; - sepNavSelRange = "{1598, 0}"; - sepNavVisRange = "{0, 821}"; + sepNavIntBoundsRect = "{{0, 0}, {755, 1274}}"; + sepNavSelRange = "{108, 11}"; + sepNavVisRange = "{0, 827}"; sepNavWindowFrame = "{{15, 4}, {976, 574}}"; }; }; 223429A414AF70B100D0B406 /* viewpoint.h */ = { uiCtxt = { sepNavIntBoundsRect = "{{0, 0}, {755, 624}}"; - sepNavSelRange = "{681, 0}"; - sepNavVisRange = "{175, 526}"; + sepNavSelRange = "{226, 0}"; + sepNavVisRange = "{0, 492}"; }; }; 22570F8114B111F1009BC2A4 /* PBXTextBookmark */ = { @@ -163,16 +123,6 @@ vrLen = 448; vrLoc = 0; }; - 22570F8214B111F1009BC2A4 /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = 22EF433914AF89EF003C3497 /* mapUtils.h */; - name = "mapUtils.h: 16"; - rLen = 0; - rLoc = 327; - rType = 0; - vrLen = 329; - vrLoc = 0; - }; 22570FEC14B131A0009BC2A4 /* ofCamera.h */ = { isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; @@ -214,36 +164,113 @@ vrLen = 830; vrLoc = 0; }; - 22578A0914B34BAC0036E99C /* PBXTextBookmark */ = { + 226875CF14B51C34006FAF1F /* ofRectangle.h */ = { + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + name = ofRectangle.h; + path = /Developer/Library/openFrameworks/libs/openFrameworks/types/ofRectangle.h; + sourceTree = ""; + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {917, 650}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{194, 914}"; + sepNavWindowFrame = "{{15, 4}, {976, 574}}"; + }; + }; + 226875D014B51C34006FAF1F /* PBXBookmark */ = { + isa = PBXBookmark; + fRef = 226875CF14B51C34006FAF1F /* ofRectangle.h */; + }; + 226875D314B51C4B006FAF1F /* PBXTextBookmark */ = { isa = PBXTextBookmark; - fRef = 223429A114AF70B100D0B406 /* keyVar.cpp */; - name = "keyVar.cpp: 54"; + fRef = 22EF433814AF89EF003C3497 /* mapUtils.cpp */; + name = "mapUtils.cpp: 11"; rLen = 0; - rLoc = 1398; + rLoc = 171; rType = 0; - vrLen = 1398; + vrLen = 739; vrLoc = 0; }; - 226875A614B5000F006FAF1F /* PBXTextBookmark */ = { + 226875D414B51C4B006FAF1F /* PBXTextBookmark */ = { isa = PBXTextBookmark; - fRef = E4B69E1E0A3A1BDC003C02F2 /* testApp.cpp */; - name = "testApp.cpp: 17"; + fRef = 22EF433914AF89EF003C3497 /* mapUtils.h */; + name = "mapUtils.h: 16"; + rLen = 0; + rLoc = 327; + rType = 0; + vrLen = 329; + vrLoc = 0; + }; + 226875D514B51C4B006FAF1F /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 223429A214AF70B100D0B406 /* keyVar.h */; + name = "keyVar.h: 1"; rLen = 0; - rLoc = 313; + rLoc = 0; rType = 0; - vrLen = 717; + vrLen = 519; vrLoc = 0; }; - 22AABA5214B4EBFD00280662 /* PBXTextBookmark */ = { + 226875D614B51C4B006FAF1F /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 223429A114AF70B100D0B406 /* keyVar.cpp */; + name = "keyVar.cpp: 5"; + rLen = 0; + rLoc = 128; + rType = 0; + vrLen = 932; + vrLoc = 533; + }; + 226875D714B51C4B006FAF1F /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 223429A414AF70B100D0B406 /* viewpoint.h */; + name = "viewpoint.h: 18"; + rLen = 0; + rLoc = 226; + rType = 0; + vrLen = 492; + vrLoc = 0; + }; + 226875D814B51C4B006FAF1F /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = E4B69E1E0A3A1BDC003C02F2 /* testApp.cpp */; - name = "testApp.cpp: 14"; + name = "testApp.cpp: 32"; + rLen = 0; + rLoc = 783; + rType = 0; + vrLen = 768; + vrLoc = 133; + }; + 226875D914B51C4B006FAF1F /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 223429A314AF70B100D0B406 /* viewpoint.cpp */; + name = "viewpoint.cpp: 49"; rLen = 0; - rLoc = 255; + rLoc = 1301; + rType = 0; + vrLen = 953; + vrLoc = 39; + }; + 226875DA14B51C4B006FAF1F /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 223429A314AF70B100D0B406 /* viewpoint.cpp */; + name = "viewpoint.cpp: 5"; + rLen = 11; + rLoc = 108; rType = 0; - vrLen = 740; + vrLen = 827; vrLoc = 0; }; + 226875DD14B51C4B006FAF1F /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = 226875CF14B51C34006FAF1F /* ofRectangle.h */; + name = "ofRectangle.h: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 913; + vrLoc = 195; + }; 22AFFECF149798EE0079DDC5 /* PBXTextBookmark */ = { isa = PBXTextBookmark; fRef = 22AFFED0149798EE0079DDC5 /* ofGraphics.h */; @@ -292,36 +319,6 @@ isa = PBXCodeSenseManager; indexTemplatePath = ""; }; - 22D4C34114B4ED2D00BC7337 /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = E4B69E1E0A3A1BDC003C02F2 /* testApp.cpp */; - name = "testApp.cpp: 14"; - rLen = 0; - rLoc = 255; - rType = 0; - vrLen = 740; - vrLoc = 0; - }; - 22D4C34B14B4F03D00BC7337 /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = E4B69E1E0A3A1BDC003C02F2 /* testApp.cpp */; - name = "testApp.cpp: 18"; - rLen = 0; - rLoc = 345; - rType = 0; - vrLen = 721; - vrLoc = 0; - }; - 22D4C35D14B4FAF600BC7337 /* PBXTextBookmark */ = { - isa = PBXTextBookmark; - fRef = E4B69E1E0A3A1BDC003C02F2 /* testApp.cpp */; - name = "testApp.cpp: 17"; - rLen = 0; - rLoc = 313; - rType = 0; - vrLen = 697; - vrLoc = 0; - }; 22EF433814AF89EF003C3497 /* mapUtils.cpp */ = { uiCtxt = { sepNavIntBoundsRect = "{{0, 0}, {761, 1248}}"; @@ -371,30 +368,29 @@ PBXFileDataSource_Target_ColumnID, ); }; - PBXPerProjectTemplateStateSaveDate = 347406347; - PBXWorkspaceStateSaveDate = 347406347; + PBXPerProjectTemplateStateSaveDate = 347413595; + PBXWorkspaceStateSaveDate = 347413595; }; perUserProjectItems = { 220EA1EF14925D45004424ED = 220EA1EF14925D45004424ED /* PBXTextBookmark */; - 2226A43014B3B80600A9FC9F = 2226A43014B3B80600A9FC9F /* PBXTextBookmark */; 2226A46F14B3BF5C00A9FC9F = 2226A46F14B3BF5C00A9FC9F /* PBXTextBookmark */; - 2226A47914B3C58400A9FC9F = 2226A47914B3C58400A9FC9F /* PBXTextBookmark */; 2226A47A14B3C58400A9FC9F = 2226A47A14B3C58400A9FC9F /* PBXTextBookmark */; 2226A47C14B3C58400A9FC9F = 2226A47C14B3C58400A9FC9F /* PBXTextBookmark */; - 2226A4A514B3CAB700A9FC9F = 2226A4A514B3CAB700A9FC9F /* PBXTextBookmark */; - 2226A4AB14B3CAEB00A9FC9F = 2226A4AB14B3CAEB00A9FC9F /* PBXTextBookmark */; 22570F8114B111F1009BC2A4 = 22570F8114B111F1009BC2A4 /* PBXTextBookmark */; - 22570F8214B111F1009BC2A4 = 22570F8214B111F1009BC2A4 /* PBXTextBookmark */; 2257104214B1404F009BC2A4 = 2257104214B1404F009BC2A4 /* PBXTextBookmark */; 2257104414B1404F009BC2A4 = 2257104414B1404F009BC2A4 /* PBXTextBookmark */; - 22578A0914B34BAC0036E99C = 22578A0914B34BAC0036E99C /* PBXTextBookmark */; - 226875A614B5000F006FAF1F /* PBXTextBookmark */ = 226875A614B5000F006FAF1F /* PBXTextBookmark */; - 22AABA5214B4EBFD00280662 = 22AABA5214B4EBFD00280662 /* PBXTextBookmark */; + 226875D014B51C34006FAF1F = 226875D014B51C34006FAF1F /* PBXBookmark */; + 226875D314B51C4B006FAF1F = 226875D314B51C4B006FAF1F /* PBXTextBookmark */; + 226875D414B51C4B006FAF1F = 226875D414B51C4B006FAF1F /* PBXTextBookmark */; + 226875D514B51C4B006FAF1F = 226875D514B51C4B006FAF1F /* PBXTextBookmark */; + 226875D614B51C4B006FAF1F = 226875D614B51C4B006FAF1F /* PBXTextBookmark */; + 226875D714B51C4B006FAF1F = 226875D714B51C4B006FAF1F /* PBXTextBookmark */; + 226875D814B51C4B006FAF1F = 226875D814B51C4B006FAF1F /* PBXTextBookmark */; + 226875D914B51C4B006FAF1F = 226875D914B51C4B006FAF1F /* PBXTextBookmark */; + 226875DA14B51C4B006FAF1F = 226875DA14B51C4B006FAF1F /* PBXTextBookmark */; + 226875DD14B51C4B006FAF1F = 226875DD14B51C4B006FAF1F /* PBXTextBookmark */; 22AFFECF149798EE0079DDC5 = 22AFFECF149798EE0079DDC5 /* PBXTextBookmark */; 22AFFED1149798EE0079DDC5 = 22AFFED1149798EE0079DDC5 /* PBXTextBookmark */; - 22D4C34114B4ED2D00BC7337 = 22D4C34114B4ED2D00BC7337 /* PBXTextBookmark */; - 22D4C34B14B4F03D00BC7337 = 22D4C34B14B4F03D00BC7337 /* PBXTextBookmark */; - 22D4C35D14B4FAF600BC7337 = 22D4C35D14B4FAF600BC7337 /* PBXTextBookmark */; }; sourceControlManager = 22C080CC1491244000E6B4C0 /* Source Control */; userBuildSettings = { @@ -416,9 +412,9 @@ }; E4B69E1E0A3A1BDC003C02F2 /* testApp.cpp */ = { uiCtxt = { - sepNavIntBoundsRect = "{{0, 0}, {755, 1781}}"; - sepNavSelRange = "{371, 0}"; - sepNavVisRange = "{0, 717}"; + sepNavIntBoundsRect = "{{0, 0}, {755, 1664}}"; + sepNavSelRange = "{783, 0}"; + sepNavVisRange = "{133, 768}"; sepNavWindowFrame = "{{15, 4}, {976, 574}}"; }; }; diff --git a/src/main.cpp b/src/main.cpp index 1ed640d..ac9bc8c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -21,7 +21,7 @@ int main( ){ ofAppGlutWindow window; - ofSetupOpenGL(&window, 512,512, OF_WINDOW); // <-------- setup the GL context + ofSetupOpenGL(&window, 800,400, OF_WINDOW); // <-------- setup the GL context glutIgnoreKeyRepeat(1); glutSetKeyRepeat(GLUT_KEY_REPEAT_OFF); //these don't work!!! printf("key repeat ignore: %i\n",glutDeviceGet(GLUT_DEVICE_IGNORE_KEY_REPEAT)); diff --git a/src/testApp.cpp b/src/testApp.cpp index 42f7055..7e448fd 100644 --- a/src/testApp.cpp +++ b/src/testApp.cpp @@ -25,10 +25,12 @@ void testApp::setup(){ mode=CALIBRATE; - views=new viewpoint[1]; + views=new viewpoint[2]; //todo: read this from xml - views[0].setup(ofGetWidth(),ofGetHeight(),0,0); + numViews=2; + views[0].setup(ofGetWidth()/2,ofGetHeight(),0,0); + views[1].setup(ofGetWidth()/2,ofGetHeight(),ofGetWidth()/2,0); activeView=0; } @@ -39,9 +41,11 @@ void testApp::update(){ //-------------------------------------------------------------- void testApp::draw(){ - - views[0].setLight(); - views[0].begin(); + for (int i=0;i