Permalink
Browse files

iOS versions of VVBufferPool and VVISFKit

most of the functionality of VVBufferPool is available in iOS, though certain texture formats/types may not be available and some functionality may be missing.  VVISFKit appears to be fully functional in our tests, though it requires GL ES 3 for some of the more complex shaders to work as expected.  all of this requires iOS 8 or later- also deleted all the old static libs for iOS and replaced them with frameworks.
  • Loading branch information...
1 parent 9f0583e commit 2476272937cee765c1ccda55237f7087337e520d @mrRay committed Jan 10, 2016
Showing with 7,108 additions and 1,540 deletions.
  1. +1 −1 DDMathParser/DDMathParser-Info.plist
  2. +19 −0 DDMathParser/DDMathParser.h
  3. +26 −0 DDMathParser/Info.plist
  4. +58 −0 GLShaderSceneTestApp/Assets.xcassets/AppIcon.appiconset/Contents.json
  5. +689 −0 GLShaderSceneTestApp/Base.lproj/MainMenu.xib
  6. +28 −0 GLShaderSceneTestApp/GLShaderSceneTestAppDelegate.h
  7. +225 −0 GLShaderSceneTestApp/GLShaderSceneTestAppDelegate.m
  8. +32 −0 GLShaderSceneTestApp/Info.plist
  9. +13 −0 GLShaderSceneTestApp/main.m
  10. +38 −0 GLShaderSceneTestApp/mblur.fs
  11. +9 −0 GLShaderSceneTestApp/passthru.vs
  12. +68 −0 ISFonIOSTest/Assets.xcassets/AppIcon.appiconset/Contents.json
  13. +27 −0 ISFonIOSTest/Base.lproj/LaunchScreen.storyboard
  14. +41 −0 ISFonIOSTest/Base.lproj/Main.storyboard
  15. +9 −0 ISFonIOSTest/ISFonIOSTestAppDelegate.h
  16. +45 −0 ISFonIOSTest/ISFonIOSTestAppDelegate.m
  17. +47 −0 ISFonIOSTest/Info.plist
  18. +18 −0 ISFonIOSTest/ViewController.h
  19. +44 −0 ISFonIOSTest/ViewController.m
  20. +53 −0 ISFonIOSTest/blueelectricspiral.fs
  21. +16 −0 ISFonIOSTest/main.m
  22. +3 −3 VVBasics-Info.plist
  23. +7 −9 VVBasics/Info.plist
  24. +2 −2 VVBasics/VVBasics.h
  25. +3 −2 VVBasics/src/MutLockArray.h
  26. +5 −1 VVBasics/src/MutLockArray.m
  27. +2 −2 VVBasics/src/MutLockDict.h
  28. +2 −2 VVBasics/src/MutNRLockArray.h
  29. +7 −0 VVBasics/src/MutNRLockArray.m
  30. +2 −9 VVBasics/src/MutNRLockDict.h
  31. +2 −2 VVBasics/src/ObjectHolder.h
  32. +2 −2 VVBasics/src/VVAssertionHandler.h
  33. +9 −1 VVBasics/src/VVBasicMacros.h
  34. +3 −1 VVBasics/src/VVBasicMacros.m
  35. +2 −2 VVBasics/src/VVStopwatch.h
  36. +3 −2 VVBasics/src/VVThreadLoop.h
  37. +11 −3 VVBasics/src/VVThreadLoop.m
  38. +0 −7 VVBasicsStatic/VVBasicsStatic-Prefix.pch
  39. +0 −31 VVBasicsStatic/VVBasicsStatic.h
  40. +27 −5 VVBufferPool/CIGLScene.h
  41. +117 −15 VVBufferPool/CIGLScene.m
  42. +42 −7 VVBufferPool/GLScene.h
  43. +273 −67 VVBufferPool/GLScene.m
  44. +7 −1 VVBufferPool/GLShaderScene.h
  45. +35 −11 VVBufferPool/GLShaderScene.m
  46. +41 −9 VVBufferPool/HapSupport.h
  47. +22 −2 VVBufferPool/HapSupport.m
  48. +26 −0 VVBufferPool/Info.plist
  49. +5 −5 VVBufferPool/QCGLScene.h
  50. +5 −5 VVBufferPool/QCGLScene.m
  51. +1 −1 VVBufferPool/RenderThread.h
  52. +7 −3 VVBufferPool/RenderThread.m
  53. +97 −17 VVBufferPool/VVBuffer.h
  54. +133 −35 VVBufferPool/VVBuffer.m
  55. +11 −4 VVBufferPool/VVBufferCopier.h
  56. +301 −26 VVBufferPool/VVBufferCopier.m
  57. +50 −0 VVBufferPool/VVBufferGLKView.h
  58. +376 −0 VVBufferPool/VVBufferGLKView.m
  59. +1 −1 VVBufferPool/VVBufferGLView.h
  60. +6 −6 VVBufferPool/VVBufferGLView.m
  61. +1 −1 VVBufferPool/VVBufferPool-Info.plist
  62. +90 −28 VVBufferPool/VVBufferPool.h
  63. +724 −123 VVBufferPool/VVBufferPool.m
  64. +2 −2 VVBufferPool/VVQCComposition.h
  65. +10 −4 VVBufferPool/VVSizingTool.h
  66. +12 −8 VVBufferPool/VVSizingTool.m
  67. +5 −0 VVISFKit/ISFAttrib.h
  68. +7 −0 VVISFKit/ISFFileManager.h
  69. +50 −0 VVISFKit/ISFFileManager.m
  70. +23 −12 VVISFKit/ISFGLScene.h
  71. +312 −36 VVISFKit/ISFGLScene.m
  72. +9 −2 VVISFKit/ISFGLSceneVertShaderIncludeInitFunc.txt
  73. +4 −0 VVISFKit/ISFGLSceneVertShaderIncludeVarDec.txt
  74. +5 −0 VVISFKit/ISFObjectAdditions.h
  75. +5 −0 VVISFKit/ISFRenderPass.h
  76. +5 −0 VVISFKit/ISFStringAdditions.h
  77. +10 −5 VVISFKit/ISFTargetBuffer.h
  78. +38 −14 VVISFKit/ISFTargetBuffer.m
  79. +5 −0 VVISFKit/ISF_ES_Compatibility.txt
  80. +26 −0 VVISFKit/Info.plist
  81. +1 −1 VVISFKit/VVISFKit-Info.plist
  82. +3 −3 VVOSC/FrameworkSrc/OSCAddressSpace.h
  83. +2 −2 VVOSC/FrameworkSrc/OSCAddressSpace.m
  84. +2 −2 VVOSC/FrameworkSrc/OSCBundle.h
  85. +2 −2 VVOSC/FrameworkSrc/OSCInPort.h
  86. +1 −1 VVOSC/FrameworkSrc/OSCInPort.m
  87. +2 −2 VVOSC/FrameworkSrc/OSCManager.h
  88. +1 −1 VVOSC/FrameworkSrc/OSCManager.m
  89. +3 −3 VVOSC/FrameworkSrc/OSCMessage.h
  90. +2 −2 VVOSC/FrameworkSrc/OSCMessage.m
  91. +2 −2 VVOSC/FrameworkSrc/OSCNode.h
  92. +2 −2 VVOSC/FrameworkSrc/OSCOutPort.h
  93. +2 −2 VVOSC/FrameworkSrc/OSCPacket.h
  94. +2 −1 VVOSC/FrameworkSrc/OSCQueryReply.h
  95. +2 −2 VVOSC/FrameworkSrc/OSCStringAdditions.h
  96. +2 −2 VVOSC/FrameworkSrc/OSCValue.h
  97. +6 −6 VVOSC/FrameworkSrc/OSCValue.m
  98. +3 −3 VVOSC/FrameworkSrc/OSCZeroConfDomain.h
  99. +3 −3 VVOSC/FrameworkSrc/OSCZeroConfManager.h
  100. +3 −3 VVOSC/FrameworkSrc/VVOSC-Info.plist
  101. +26 −0 VVOSC/Info.plist
  102. +0 −7 VVOSCStatic/VVOSCStatic-Prefix.pch
  103. +0 −9 VVOSCStatic/VVOSCStatic.h
  104. +2,156 −667 VVOpenSource.xcodeproj/project.pbxproj
  105. +8 −5 VVOpenSource.xcodeproj/xcshareddata/xcschemes/vvopensource-Build Mac Fmwks & Apps.xcscheme
  106. +8 −5 VVOpenSource.xcodeproj/xcshareddata/xcschemes/vvopensource-Build Mac Frameworks.xcscheme
  107. +80 −0 VVOpenSource.xcodeproj/xcshareddata/xcschemes/vvopensource-Build iOS Fmwks & Apps.xcscheme
  108. +12 −9 ...chemes/{vvopensource-Build iOS static libs.xcscheme → vvopensource-Build iOS Frameworks.xcscheme}
  109. +26 −0 VVUIToolbox/Info.plist
  110. +3 −2 VVUIToolbox/VVScrollView.h
  111. +29 −14 VVUIToolbox/VVScrollView.m
  112. +7 −6 VVUIToolbox/VVSprite.h
  113. +7 −7 VVUIToolbox/VVSprite.m
  114. +2 −1 VVUIToolbox/VVSpriteGLKView.h
  115. +28 −0 VVUIToolbox/VVSpriteGLKView.m
  116. +1 −0 VVUIToolbox/VVSpriteGLView.h
  117. +24 −2 VVUIToolbox/VVSpriteGLView.m
  118. +7 −6 VVUIToolbox/VVSpriteManager.h
  119. +13 −13 VVUIToolbox/VVSpriteManager.m
  120. +2 −1 VVUIToolbox/VVTrackingArea.h
  121. +1 −1 VVUIToolbox/VVUIToolbox-Info.plist
  122. +2 −1 VVUIToolbox/VVUIToolbox.h
  123. +17 −22 VVUIToolbox/VVView.h
  124. +106 −76 VVUIToolbox/VVView.m
  125. +0 −9 VVUIToolboxStatic/VVUIToolboxStatic-Prefix.pch
  126. +0 −9 VVUIToolboxStatic/VVUIToolboxStatic.h
  127. +0 −4 scripts/AddIPHONEDefine.sh
  128. +0 −82 scripts/assembleSDK.sh
@@ -9,7 +9,7 @@
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
- <string>com.Vidvox.${PRODUCT_NAME:rfc1034identifier}</string>
+ <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
@@ -0,0 +1,19 @@
+//
+// DDMathParser.h
+// DDMathParser
+//
+// Created by testAdmin on 1/10/16.
+//
+//
+
+#import <UIKit/UIKit.h>
+
+//! Project version number for DDMathParser.
+FOUNDATION_EXPORT double DDMathParserVersionNumber;
+
+//! Project version string for DDMathParser.
+FOUNDATION_EXPORT const unsigned char DDMathParserVersionString[];
+
+// In this header, you should import all the public headers of your framework using statements like #import <DDMathParser/PublicHeader.h>
+
+
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>en</string>
+ <key>CFBundleExecutable</key>
+ <string>$(EXECUTABLE_NAME)</string>
+ <key>CFBundleIdentifier</key>
+ <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>$(PRODUCT_NAME)</string>
+ <key>CFBundlePackageType</key>
+ <string>FMWK</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>$(CURRENT_PROJECT_VERSION)</string>
+ <key>NSPrincipalClass</key>
+ <string></string>
+</dict>
+</plist>
@@ -0,0 +1,58 @@
+{
+ "images" : [
+ {
+ "idiom" : "mac",
+ "size" : "16x16",
+ "scale" : "1x"
+ },
+ {
+ "idiom" : "mac",
+ "size" : "16x16",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "mac",
+ "size" : "32x32",
+ "scale" : "1x"
+ },
+ {
+ "idiom" : "mac",
+ "size" : "32x32",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "mac",
+ "size" : "128x128",
+ "scale" : "1x"
+ },
+ {
+ "idiom" : "mac",
+ "size" : "128x128",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "mac",
+ "size" : "256x256",
+ "scale" : "1x"
+ },
+ {
+ "idiom" : "mac",
+ "size" : "256x256",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "mac",
+ "size" : "512x512",
+ "scale" : "1x"
+ },
+ {
+ "idiom" : "mac",
+ "size" : "512x512",
+ "scale" : "2x"
+ }
+ ],
+ "info" : {
+ "version" : 1,
+ "author" : "xcode"
+ }
+}
Oops, something went wrong.
@@ -0,0 +1,28 @@
+#import <Cocoa/Cocoa.h>
+#import <VVBasics/VVBasics.h>
+#import <VVBufferPool/VVBufferPool.h>
+
+
+
+
+@interface GLShaderSceneTestAppDelegate : NSObject <NSApplicationDelegate> {
+ CVDisplayLinkRef displayLink;
+ NSOpenGLContext *sharedContext;
+ IBOutlet VVBufferGLView *bufferView;
+
+ CIFilter *checkerboardSrc;
+ CIGLScene *ciScene; // this renders a CIImage to a GL texture
+ GLShaderScene *glslScene; // this uses a GLSL program to apply a "motion blur" to the video from "ciScene"
+ VVBuffer *ciBuffer; // only non-nil during a rendering callback (retained, just in case). when you rener ciScene to a buffer, you render to this buffer. an instance var in the class because the shader scene callback needs a way to retrieve the latest-rendered image from CI
+ VVBuffer *accumBuffer; // the GLSL scene renders into this buffer, which we keep and pass to the shader each frame to acheive the motion blur
+ VVStopwatch *swatch; // used to animate the size of the checkerboard
+}
+
+- (void) renderCallback;
+
+@end
+
+
+
+
+CVReturn displayLinkCallback(CVDisplayLinkRef displayLink, const CVTimeStamp *inNow, const CVTimeStamp *inOutputTime, CVOptionFlags flagsIn, CVOptionFlags *flagsOut, void *displayLinkContext);
@@ -0,0 +1,225 @@
+#import "GLShaderSceneTestAppDelegate.h"
+#import <OpenGL/CGLMacro.h>
+
+
+
+
+@implementation GLShaderSceneTestAppDelegate
+
+
+- (id) init {
+ if (self = [super init]) {
+ // make a shared GL context. other GL contexts created to share this one may share resources (textures, buffers, etc).
+ sharedContext = [[NSOpenGLContext alloc] initWithFormat:[GLScene defaultPixelFormat] shareContext:nil];
+
+ // create the global buffer pool from the shared context
+ [VVBufferPool createGlobalVVBufferPoolWithSharedContext:sharedContext];
+ // ...other stuff in the VVBufferPool framework- like the views, the buffer copier, etc- will
+ // automatically use the global buffer pool's shared context to set themselves up to function with the pool.
+
+
+ // set up the CoreImage backend to work with the shared context. using this approach, the CIGLScene will actually use 'sharedContext' (or whatever context you pass in its place) to do rendering, rather than creating a new GL context reserved solely for CI
+ [CIGLScene prepCommonCIBackendToRenderOnContext:sharedContext pixelFormat:[GLScene defaultPixelFormat]];
+ // make a CIGLScene. this is a GL context that will be used to render CIImages to GL textures.
+ ciScene = [[CIGLScene alloc] initCommonBackendSceneSized:NSMakeSize(640,480)];
+ /*
+ // make a CIGLScene. this is a GL context that will be used to render CIImages to GL textures. using this approach, the CIGLScene will create its own GL context, and use that to do rendering.
+ ciScene = [[CIGLScene alloc] initWithSharedContext:sharedContext];
+ [ciScene setSize:NSMakeSize(640,480)]; // this sets the render resolution...
+ */
+
+
+ // make a checkerboard CIFilter, set its defaults
+ checkerboardSrc = [[CIFilter filterWithName:@"CICheckerboardGenerator"] retain];
+ [checkerboardSrc setDefaults];
+
+ // make a stopwatch that we'll use to crudely animate the size of the checkerboard
+ swatch = [[VVStopwatch alloc] init];
+ [swatch start];
+
+ // make a GLSLShaderScene, tell it to load the frag + vert shaders included with this app
+ NSBundle *mb = [NSBundle mainBundle];
+ glslScene = [[GLShaderScene alloc] initWithSharedContext:sharedContext sized:VVMAKESIZE(640,480)];
+ [glslScene setVertexShaderString:[NSString stringWithContentsOfFile:[mb pathForResource:@"passthru" ofType:@"vs"] encoding:NSUTF8StringEncoding error:nil]];
+ [glslScene setFragmentShaderString:[NSString stringWithContentsOfFile:[mb pathForResource:@"mblur" ofType:@"fs"] encoding:NSUTF8StringEncoding error:nil]];
+ [glslScene setRenderTarget:self];
+ [glslScene setRenderSelector:@selector(shaderSceneCallback:)];
+
+ ciBuffer = nil;
+ accumBuffer = nil;
+
+ return self;
+ }
+ [self release];
+ return nil;
+}
+- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
+ // make the displaylink, which will drive rendering
+ CVReturn err = kCVReturnSuccess;
+ CGOpenGLDisplayMask totalDisplayMask = 0;
+ GLint virtualScreen = 0;
+ GLint displayMask = 0;
+ NSOpenGLPixelFormat *format = [GLScene defaultPixelFormat];
+
+ for (virtualScreen=0; virtualScreen<[format numberOfVirtualScreens]; ++virtualScreen) {
+ [format getValues:&displayMask forAttribute:NSOpenGLPFAScreenMask forVirtualScreen:virtualScreen];
+ totalDisplayMask |= displayMask;
+ }
+ err = CVDisplayLinkCreateWithOpenGLDisplayMask(totalDisplayMask, &displayLink);
+ if (err) {
+ NSLog(@"\t\terr %d creating display link in %s",err,__func__);
+ displayLink = NULL;
+ }
+ else {
+ CVDisplayLinkSetOutputCallback(displayLink, displayLinkCallback, self);
+ CVDisplayLinkStart(displayLink);
+ }
+}
+// this method is called from the displaylink callback
+- (void) renderCallback {
+
+ // determine the size of the square based on the stopwatch, apply it to the CIFilter
+ double squareSize = (fmod([swatch timeSinceStart], 5.0) / 5.0) * 64.0;
+ [checkerboardSrc setValue:[NSNumber numberWithDouble:squareSize] forKey:@"inputWidth"];
+ // we're going to need an FBO, we're going to render to a couple textures before display
+ VVBuffer *fbo = [[VVBufferPool globalVVBufferPool] allocFBO];
+
+ // get a CIImage from the CIFilter
+ CIImage *startImg = [checkerboardSrc valueForKey:@"outputImage"];
+ // tell the CI scene to render a buffer from the CIImage (this renders the CIImage to a GL texture). note that we're explicitly rendering into a 2D texture...
+ VVRELEASE(ciBuffer);
+ ciBuffer = [[VVBufferPool globalVVBufferPool] allocBGR2DTexSized:VVMAKESIZE(640,480)];
+ [ciScene renderCIImage:startImg inFBO:[fbo name] colorTex:[ciBuffer name] target:[ciBuffer target]];
+ if (ciBuffer == nil) {
+ NSLog(@"\t\terr: ciBuffer nil in %s",__func__);
+ return;
+ }
+
+ // if there's no accumulator buffer, make one by duplicating the buffer from the CI scene. again, we're explicitly rendering to a 2D texture...
+ if (accumBuffer == nil) {
+ accumBuffer = [[VVBufferPool globalVVBufferPool] allocBGR2DTexSized:VVMAKESIZE(640,480)];
+ [[VVBufferCopier globalBufferCopier] copyThisBuffer:ciBuffer toThisBuffer:accumBuffer];
+ }
+
+ // tell the shader scene to render a buffer. this calls the shader scene callback, which is where we pass values to the shader!
+ VVBuffer *newGLSLBuffer = [[VVBufferPool globalVVBufferPool] allocBGR2DTexSized:VVMAKESIZE(640,480)];
+ [glslScene renderInMSAAFBO:0 colorRB:0 depthRB:0 fbo:[fbo name] colorTex:[newGLSLBuffer name] depthTex:0 target:[newGLSLBuffer target]];
+
+ // draw something!
+ [bufferView drawBuffer:newGLSLBuffer];
+
+ // update the accumBuffer (get rid of the old, use the new buffer rendered by the glsl scene)
+ VVRELEASE(accumBuffer);
+ accumBuffer = [newGLSLBuffer retain];
+
+ // release the buffers we allocated
+ VVRELEASE(newGLSLBuffer);
+ VVRELEASE(ciBuffer);
+ VVRELEASE(fbo);
+
+ // tell the buffer pool to do its housekeeping (releases any "old" resources in the pool that have been sticking around for a while)
+ [[VVBufferPool globalVVBufferPool] housekeeping];
+}
+// this method is called when you tell "glslScene" to render- in it we pass values to the shader and then draw a quad
+- (void) shaderSceneCallback:(GLScene *)scene {
+ //NSLog(@"%s",__func__);
+ NSOpenGLContext *context = [scene context];
+ if (context == nil)
+ return;
+ CGLContextObj cgl_ctx = [context CGLContextObj];
+
+ // pass values (textures & data that describes the textures) to the GLSL program
+ GLenum glslProgram = [(GLShaderScene *)scene program];
+ if (glslProgram > 0) {
+ GLint samplerLoc = 0;
+ VVRECT tmpRect;
+ VVSIZE tmpSize;
+
+ samplerLoc = glGetUniformLocation(glslProgram,"inputTexture");
+ if (samplerLoc >= 0) {
+ glActiveTexture(GL_TEXTURE0);
+ glBindTexture([ciBuffer target], [ciBuffer name]);
+ glUniform1i(samplerLoc,0);
+ }
+ else
+ NSLog(@"\t\terr: couldn't locate inputTexture sampler, %s",__func__);
+
+ samplerLoc = glGetUniformLocation(glslProgram,"accumTexture");
+ if (samplerLoc >= 0) {
+ glActiveTexture(GL_TEXTURE1);
+ glBindTexture([accumBuffer target], [accumBuffer name]);
+ glUniform1i(samplerLoc,1);
+ }
+ else
+ NSLog(@"\t\terr: couldn't locate accumTexture sampler, %s",__func__);
+
+ samplerLoc = glGetUniformLocation(glslProgram,"blurAmount");
+ if (samplerLoc >= 0) {
+ glUniform1f(samplerLoc, 0.95);
+ }
+ else
+ NSLog(@"\t\terr: couldn't locate blurAmount uniform, %s",__func__);
+
+ samplerLoc = glGetUniformLocation(glslProgram,"inputCropRect");
+ if (samplerLoc >= 0) {
+ tmpRect = [ciBuffer glReadySrcRect];
+ glUniform4f(samplerLoc, tmpRect.origin.x, tmpRect.origin.y, tmpRect.size.width, tmpRect.size.height);
+ }
+ else
+ NSLog(@"\t\terr: couldn't locate inputCropRect sampler, %s",__func__);
+
+ samplerLoc = glGetUniformLocation(glslProgram,"accumCropRect");
+ if (samplerLoc >= 0) {
+ tmpRect = [accumBuffer glReadySrcRect];
+ glUniform4f(samplerLoc, tmpRect.origin.x, tmpRect.origin.y, tmpRect.size.width, tmpRect.size.height);
+ }
+ else
+ NSLog(@"\t\terr: couldn't locate accumCropRect sampler, %s",__func__);
+
+ samplerLoc = glGetUniformLocation(glslProgram,"flipFlag");
+ if (samplerLoc >= 0) {
+ glUniform2f(samplerLoc, ([ciBuffer flipped]?1.0:0.0), ([accumBuffer flipped]?1.0:0.0));
+ }
+ else
+ NSLog(@"\t\terr: couldn't locate flipFlag sampler, %s",__func__);
+
+ tmpSize = [scene size];
+ samplerLoc = glGetUniformLocation(glslProgram,"canvasSize");
+ if (samplerLoc >= 0) {
+ glUniform2f(samplerLoc, tmpSize.width, tmpSize.height);
+ }
+ else
+ NSLog(@"\t\terr: couldn't locate canvasSize sampler, %s",__func__);
+ }
+ else
+ NSLog(@"\t\terr: can't pass vals to shader, %s",__func__);
+
+ // draw a quad
+ glActiveTexture(GL_TEXTURE0);
+
+ NSSize s = [scene size];
+ NSRect r = NSMakeRect(0,0,s.width,s.height);
+
+ glEnableClientState(GL_VERTEX_ARRAY);
+ glEnableClientState(GL_TEXTURE_COORD_ARRAY);
+ GLDRAWTEXQUADMACRO([ciBuffer name], [ciBuffer target], [ciBuffer flipped], [ciBuffer glReadySrcRect], r);
+}
+
+
+@end
+
+
+
+
+CVReturn displayLinkCallback(CVDisplayLinkRef displayLink,
+ const CVTimeStamp *inNow,
+ const CVTimeStamp *inOutputTime,
+ CVOptionFlags flagsIn,
+ CVOptionFlags *flagsOut,
+ void *displayLinkContext)
+{
+ NSAutoreleasePool *pool =[[NSAutoreleasePool alloc] init];
+ [(GLShaderSceneTestAppDelegate *)displayLinkContext renderCallback];
+ [pool release];
+ return kCVReturnSuccess;
+}
Oops, something went wrong.

0 comments on commit 2476272

Please sign in to comment.