Commits

Cliff Biffle  committed e1f884f

KVRenderer now defines an option for controlling texturing.

  • Participants
  • Parent commits 33b7839
  • Branches shaders

Comments (0)

Files changed (2)

File KVRenderer.h

 
 - (void) drawInCurrentOpenGLContextWithOptions: (NSDictionary *) options;
 
-@end
+@end
+
+extern const NSString * const KVSurfaceMode;
+extern const NSString * const KVPlainSurfaceMode;
+extern const NSString * const KVTexturedSurfaceMode;

File KVRenderer.m

 #import "KVRenderer.h"
 #import "utility.h"
 
+const NSString * const KVSurfaceMode = @"KVSurfaceMode";
+const NSString * const KVPlainSurfaceMode = @"KVPlainSurfaceMode";
+const NSString * const KVTexturedSurfaceMode = @"KVTexturedSurfaceMode";
+
 @interface KVRenderer ()
 - (void) buildPointField;
 - (GLuint) loadShaderOfType: (GLenum) type fromFiles: (NSArray *) names;
 }
 
 - (void) drawInCurrentOpenGLContextWithOptions: (NSDictionary *) options {
-  BOOL textureFromCamera = NO;  // TODO read from options
+  BOOL textureFromCamera = [[options objectForKey: KVSurfaceMode] boolValue];
   
   NSTimeInterval start = [NSDate timeIntervalSinceReferenceDate];