Skip to content

Commit

Permalink
Fixed GPUImageView for usage with Yosemite.
Browse files Browse the repository at this point in the history
  • Loading branch information
BradLarson committed Oct 12, 2014
1 parent 594a933 commit 3be2eb5
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 22 deletions.
Expand Up @@ -32,19 +32,19 @@
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
BCF867241725A69A00912E34 /* PBXContainerItemProxy */ = {
BC3240A619E5DE6C001EAB0E /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = BCB5E80C14E610BE00701302 /* GPUImage.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = BCF1A33414DDB1EC00852800;
remoteInfo = GPUImage;
remoteGlobalIDString = BCE209E51943F20C002FEED8;
remoteInfo = GPUImageFramework;
};
BCF867261725A69A00912E34 /* PBXContainerItemProxy */ = {
BCF867241725A69A00912E34 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = BCB5E80C14E610BE00701302 /* GPUImage.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = BCF1A34414DDB1EC00852800;
remoteInfo = GPUImageTests;
remoteGlobalIDString = BCF1A33414DDB1EC00852800;
remoteInfo = GPUImage;
};
BCF867281725A6AD00912E34 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
Expand Down Expand Up @@ -174,7 +174,7 @@
isa = PBXGroup;
children = (
BCF867251725A69A00912E34 /* libGPUImage.a */,
BCF867271725A69A00912E34 /* GPUImageTests.octest */,
BC3240A719E5DE6C001EAB0E /* GPUImage.framework */,
);
name = Products;
sourceTree = "<group>";
Expand Down Expand Up @@ -233,20 +233,20 @@
/* End PBXProject section */

/* Begin PBXReferenceProxy section */
BC3240A719E5DE6C001EAB0E /* GPUImage.framework */ = {
isa = PBXReferenceProxy;
fileType = wrapper.framework;
path = GPUImage.framework;
remoteRef = BC3240A619E5DE6C001EAB0E /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
BCF867251725A69A00912E34 /* libGPUImage.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libGPUImage.a;
remoteRef = BCF867241725A69A00912E34 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
BCF867271725A69A00912E34 /* GPUImageTests.octest */ = {
isa = PBXReferenceProxy;
fileType = wrapper.cfbundle;
path = GPUImageTests.octest;
remoteRef = BCF867261725A69A00912E34 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
/* End PBXReferenceProxy section */

/* Begin PBXResourcesBuildPhase section */
Expand Down Expand Up @@ -332,7 +332,7 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = "../../../framework/**";
IPHONEOS_DEPLOYMENT_TARGET = 4.0;
IPHONEOS_DEPLOYMENT_TARGET = 4.3;
ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = "-ObjC";
SDKROOT = iphoneos;
Expand Down Expand Up @@ -363,7 +363,7 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = "../../../framework/**";
IPHONEOS_DEPLOYMENT_TARGET = 4.0;
IPHONEOS_DEPLOYMENT_TARGET = 4.3;
OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
OTHER_LDFLAGS = "-ObjC";
SDKROOT = iphoneos;
Expand Down
24 changes: 18 additions & 6 deletions framework/Source/Mac/GPUImageView.m
Expand Up @@ -355,12 +355,24 @@ - (void)newFrameReadyAtTime:(CMTime)frameTime atIndex:(NSInteger)textureIndex;
glVertexAttribPointer(displayPositionAttribute, 2, GL_FLOAT, 0, 0, imageVertices);
glVertexAttribPointer(displayTextureCoordinateAttribute, 2, GL_FLOAT, 0, 0, [GPUImageView textureCoordinatesForRotation:inputRotation]);

[self lockFocus];
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);

[self presentFramebuffer];
glBindTexture(GL_TEXTURE_2D, 0);
[self unlockFocus];
BOOL canLockFocus = YES;
if ([self respondsToSelector:@selector(lockFocusIfCanDraw)])
{
canLockFocus = [self lockFocusIfCanDraw];
}
else
{
[self lockFocus];
}

if (canLockFocus)
{
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);

[self presentFramebuffer];
glBindTexture(GL_TEXTURE_2D, 0);
[self unlockFocus];
}

[inputFramebufferForDisplay unlock];
inputFramebufferForDisplay = nil;
Expand Down

0 comments on commit 3be2eb5

Please sign in to comment.