Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Use of new Xcode and added a new demo transition.

  • Loading branch information...
commit 244dbf820a6b029b98d2dd181d99021f33bfb0cd 1 parent 9cf8d78
Edward Patel authored
View
2  DemoProject/Classes/MainViewController.h
@@ -11,6 +11,6 @@
@interface MainViewController : UIViewController <FlipsideViewControllerDelegate> {
}
-- (IBAction)showInfo;
+- (IBAction)showInfo:(id)sender;
@end
View
21 DemoProject/Classes/MainViewController.m
@@ -10,6 +10,7 @@
#import "MainView.h"
#import "DemoTransition.h"
+#import "Demo2Transition.h"
@implementation MainViewController
@@ -45,23 +46,31 @@ - (void)flipsideViewControllerDidFinish:(FlipsideViewController *)controller {
}
-- (IBAction)showInfo {
-
+- (IBAction)showInfo:(id)sender
+{
FlipsideViewController *controller = [[FlipsideViewController alloc]
initWithNibName:@"FlipsideView"
bundle:nil];
controller.delegate = self;
- DemoTransition *transition = [[[DemoTransition alloc] init] autorelease];
+ NSObject<EPGLTransitionViewDelegate> *transition;
+
+ if ([sender tag])
+ transition = [[[Demo2Transition alloc] init] autorelease];
+ else
+ transition = [[[DemoTransition alloc] init] autorelease];
EPGLTransitionView *glview = [[[EPGLTransitionView alloc]
initWithView:self.view
delegate:transition] autorelease];
+ if ([sender tag])
+ [glview prepareTextureTo:controller.view];
+
#ifdef ENABLE_PHASE_IN
-
- // Get texture for the "next" view
- [glview prepareTextureTo:controller.view];
+ else
+ // Get texture for the "next" view
+ [glview prepareTextureTo:controller.view];
// If you are using an "IN" animation for the "next" view set appropriate
// clear color (ie no alpha)
View
6 DemoProject/DemoProject.xcodeproj/project.pbxproj
@@ -25,6 +25,7 @@
3A112DAE113A8ED3004D04A4 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3A112DAD113A8ED3004D04A4 /* OpenGLES.framework */; };
3A112DC2113A8F7B004D04A4 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3A112DC1113A8F7B004D04A4 /* QuartzCore.framework */; };
3A112DE0113A9345004D04A4 /* painting.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 3A112DDF113A9345004D04A4 /* painting.jpg */; };
+ 3A7D0F70117A423D00CFAD01 /* Demo2Transition.m in Sources */ = {isa = PBXBuildFile; fileRef = 3A7D0F6F117A423D00CFAD01 /* Demo2Transition.m */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
@@ -55,6 +56,8 @@
3A112DAD113A8ED3004D04A4 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; };
3A112DC1113A8F7B004D04A4 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
3A112DDF113A9345004D04A4 /* painting.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = painting.jpg; sourceTree = "<group>"; };
+ 3A7D0F6E117A423D00CFAD01 /* Demo2Transition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Demo2Transition.h; path = ../src/Demo2Transition.h; sourceTree = SOURCE_ROOT; };
+ 3A7D0F6F117A423D00CFAD01 /* Demo2Transition.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Demo2Transition.m; path = ../src/Demo2Transition.m; sourceTree = SOURCE_ROOT; };
8D1107310486CEB800E47090 /* DemoProject-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "DemoProject-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = "<group>"; };
/* End PBXFileReference section */
@@ -168,6 +171,8 @@
children = (
3A112DA0113A8E8E004D04A4 /* DemoTransition.h */,
3A112DA1113A8E8E004D04A4 /* DemoTransition.m */,
+ 3A7D0F6E117A423D00CFAD01 /* Demo2Transition.h */,
+ 3A7D0F6F117A423D00CFAD01 /* Demo2Transition.m */,
3A112DA2113A8E8E004D04A4 /* EPGLTransitionView.h */,
3A112DA3113A8E8E004D04A4 /* EPGLTransitionView.m */,
);
@@ -246,6 +251,7 @@
289233B00DB2D0DB0083E9F9 /* FlipsideViewController.m in Sources */,
3A112DA4113A8E8E004D04A4 /* DemoTransition.m in Sources */,
3A112DA5113A8E8E004D04A4 /* EPGLTransitionView.m in Sources */,
+ 3A7D0F70117A423D00CFAD01 /* Demo2Transition.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
View
78 DemoProject/MainView.xib
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.10">
<data>
- <int key="IBDocument.SystemTarget">784</int>
- <string key="IBDocument.SystemVersion">10C540</string>
- <string key="IBDocument.InterfaceBuilderVersion">740</string>
- <string key="IBDocument.AppKitVersion">1038.25</string>
- <string key="IBDocument.HIToolboxVersion">458.00</string>
+ <int key="IBDocument.SystemTarget">800</int>
+ <string key="IBDocument.SystemVersion">10D573</string>
+ <string key="IBDocument.InterfaceBuilderVersion">762</string>
+ <string key="IBDocument.AppKitVersion">1038.29</string>
+ <string key="IBDocument.HIToolboxVersion">460.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
- <string key="NS.object.0">62</string>
+ <string key="NS.object.0">87</string>
</object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -31,9 +31,11 @@
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBProxyObject" id="372490531">
<string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBProxyObject" id="815241450">
<string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBUIView" id="883825266">
<reference key="NSNextResponder"/>
@@ -49,6 +51,7 @@
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<int key="IBUIContentMode">4</int>
<bool key="IBUIUserInteractionEnabled">NO</bool>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<object class="NSCustomResource" key="IBUIImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">painting.jpg</string>
@@ -61,16 +64,17 @@
<reference key="NSSuperview" ref="883825266"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
- <object class="NSFont" key="IBUIFont">
+ <object class="NSFont" key="IBUIFont" id="559432368">
<string key="NSName">Helvetica-Bold</string>
<double key="NSSize">15</double>
<int key="NSfFlags">16</int>
</object>
<int key="IBUIButtonType">1</int>
- <string key="IBUINormalTitle">Go</string>
- <object class="NSColor" key="IBUIHighlightedTitleColor">
+ <string key="IBUINormalTitle">Fall</string>
+ <object class="NSColor" key="IBUIHighlightedTitleColor" id="211966727">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
</object>
@@ -78,11 +82,32 @@
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MC4xOTYwNzg0MzE0IDAuMzA5ODAzOTIxNiAwLjUyMTU2ODYyNzUAA</bytes>
</object>
- <object class="NSColor" key="IBUINormalTitleShadowColor">
+ <object class="NSColor" key="IBUINormalTitleShadowColor" id="550989507">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MC41AA</bytes>
</object>
</object>
+ <object class="IBUIButton" id="9374807">
+ <reference key="NSNextResponder" ref="883825266"/>
+ <int key="NSvFlags">265</int>
+ <string key="NSFrame">{{196, 350}, {104, 41}}</string>
+ <reference key="NSSuperview" ref="883825266"/>
+ <bool key="IBUIOpaque">NO</bool>
+ <bool key="IBUIClearsContextBeforeDrawing">NO</bool>
+ <int key="IBUITag">1</int>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <int key="IBUIContentHorizontalAlignment">0</int>
+ <int key="IBUIContentVerticalAlignment">0</int>
+ <reference key="IBUIFont" ref="559432368"/>
+ <int key="IBUIButtonType">1</int>
+ <string key="IBUINormalTitle">Turn</string>
+ <reference key="IBUIHighlightedTitleColor" ref="211966727"/>
+ <object class="NSColor" key="IBUINormalTitleColor">
+ <int key="NSColorSpace">1</int>
+ <bytes key="NSRGB">MC4xOTYwNzg0MzE0IDAuMzA5ODAzOTIxNiAwLjUyMTU2ODYyNzUAA</bytes>
+ </object>
+ <reference key="IBUINormalTitleShadowColor" ref="550989507"/>
+ </object>
</object>
<string key="NSFrameSize">{320, 460}</string>
<reference key="NSSuperview"/>
@@ -95,6 +120,7 @@
</object>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
</object>
<object class="IBObjectContainer" key="IBDocument.Objects">
@@ -110,12 +136,21 @@
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchEventConnection" key="connection">
- <string key="label">showInfo</string>
+ <string key="label">showInfo:</string>
+ <reference key="source" ref="9374807"/>
+ <reference key="destination" ref="372490531"/>
+ <int key="IBEventType">7</int>
+ </object>
+ <int key="connectionID">41</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchEventConnection" key="connection">
+ <string key="label">showInfo:</string>
<reference key="source" ref="558454645"/>
<reference key="destination" ref="372490531"/>
<int key="IBEventType">7</int>
</object>
- <int key="connectionID">37</int>
+ <int key="connectionID">42</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
@@ -145,6 +180,7 @@
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="211512961"/>
<reference ref="558454645"/>
+ <reference ref="9374807"/>
</object>
<reference key="parent" ref="0"/>
</object>
@@ -158,6 +194,11 @@
<reference key="object" ref="211512961"/>
<reference key="parent" ref="883825266"/>
</object>
+ <object class="IBObjectRecord">
+ <int key="objectID">39</int>
+ <reference key="object" ref="9374807"/>
+ <reference key="parent" ref="883825266"/>
+ </object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
@@ -171,6 +212,7 @@
<string>34.IBPluginDependency</string>
<string>36.IBPluginDependency</string>
<string>38.IBPluginDependency</string>
+ <string>39.IBPluginDependency</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -181,6 +223,7 @@
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</object>
</object>
<object class="NSMutableDictionary" key="unlocalizedProperties">
@@ -199,7 +242,7 @@
</object>
</object>
<nil key="sourceID"/>
- <int key="maxID">38</int>
+ <int key="maxID">42</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -216,7 +259,7 @@
<string key="className">MainViewController</string>
<string key="superclassName">UIViewController</string>
<object class="NSMutableDictionary" key="actions">
- <string key="NS.key.0">showInfo</string>
+ <string key="NS.key.0">showInfo:</string>
<string key="NS.object.0">id</string>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
@@ -445,6 +488,7 @@
</object>
</object>
<int key="IBDocument.localizationMode">0</int>
+ <string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3</string>
<integer value="3100" key="NS.object.0"/>
@@ -452,6 +496,10 @@
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<string key="IBDocument.LastKnownRelativeProjectPath">DemoProject.xcodeproj</string>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
- <string key="IBCocoaTouchPluginVersion">3.1</string>
+ <object class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes">
+ <string key="NS.key.0">painting.jpg</string>
+ <string key="NS.object.0">{320, 480}</string>
+ </object>
+ <string key="IBCocoaTouchPluginVersion">87</string>
</data>
</archive>
View
35 src/Demo2Transition.h
@@ -0,0 +1,35 @@
+/* ===========================================================================
+
+ Copyright (c) 2010 Edward Patel
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
+
+ =========================================================================== */
+
+#import "EPGLTransitionView.h"
+
+//
+// TBD
+//
+
+@interface Demo2Transition : NSObject<EPGLTransitionViewDelegate> {
+ float f;
+}
+
+@end
View
96 src/Demo2Transition.m
@@ -0,0 +1,96 @@
+/* ===========================================================================
+
+ Copyright (c) 2010 Edward Patel
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
+
+ =========================================================================== */
+
+#import "Demo2Transition.h"
+
+@implementation Demo2Transition
+
+- (void)setupTransition
+{
+ // Setup matrices
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glFrustumf(-0.1, 0.1, -0.15, 0.15, 0.4, 100.0);
+ glMatrixMode(GL_MODELVIEW);
+ glLoadIdentity();
+ glEnable(GL_CULL_FACE);
+ f = 0;
+}
+
+// GL context is active and screen texture bound to be used
+- (BOOL)drawTransitionFrameWithTextureFrom:(GLuint)textureFromView
+ textureTo:(GLuint)textureToView
+{
+ GLfloat vertices[] = {
+ -1, -1.5,
+ 0, -1.5,
+ -1, 1.5,
+ 0, 1.5,
+ 0, -1.5,
+ 1, -1.5,
+ 0, 1.5,
+ 1, 1.5,
+ };
+
+ GLfloat texcoords[] = {
+ 0.0, 1,
+ 0.5, 1,
+ 0.0, 0,
+ 0.5, 0,
+ 0.5, 1,
+ 1.0, 1,
+ 0.5, 0,
+ 1.0, 0,
+ };
+
+ glVertexPointer(2, GL_FLOAT, 0, vertices);
+ glEnableClientState(GL_VERTEX_ARRAY);
+ glTexCoordPointer(2, GL_FLOAT, 0, texcoords);
+ glEnableClientState(GL_TEXTURE_COORD_ARRAY);
+
+ float v = -(-cos(f)+1.0)/2.0; // For a little ease-in-ease-out
+
+ glPushMatrix();
+ glTranslatef(0, 0, -4);
+ glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
+ glPushMatrix();
+ glRotatef(v*180.0, 0, 1, 0);
+ glDrawArrays(GL_TRIANGLE_STRIP, 4, 4);
+ glRotatef(180.0, 0, 1, 0);
+ glBindTexture(GL_TEXTURE_2D, textureToView);
+ glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
+ glPopMatrix();
+ glDrawArrays(GL_TRIANGLE_STRIP, 4, 4);
+ glPopMatrix();
+
+ f += M_PI/40.0;
+
+ return f < M_PI;
+}
+
+- (void)transitionEnded
+{
+}
+
+@end
Please sign in to comment.
Something went wrong with that request. Please try again.