-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathKinemeGLClearDepthPatch.m
More file actions
56 lines (43 loc) · 983 Bytes
/
KinemeGLClearDepthPatch.m
File metadata and controls
56 lines (43 loc) · 983 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/*
* GLClearDepth.m
* GLTools
*
* Created by Christopher Wright on 9/17/08.
* Copyright (c) 2008 Kosada Incorporated. All rights reserved.
*
*/
#import <OpenGL/CGLMacro.h>
#import "KinemeGLClearDepthPatch.h"
@implementation KinemeGLClearDepthPatch : QCPatch
+ (QCPatchExecutionMode)executionModeWithIdentifier:(id)fp8
{
return 1;
}
+ (BOOL)allowsSubpatchesWithIdentifier:(id)fp8
{
return NO;
}
+ (BOOL)isSafe
{
return YES;
}
- (id)initWithIdentifier:(id)fp8
{
if(self=[super initWithIdentifier:fp8])
{
[inputDepth setDoubleValue: 1];
[[self userInfo] setObject:@"Kineme GL Clear Depth" forKey:@"name"];
}
return self;
}
- (BOOL)execute:(QCOpenGLContext *)context time:(double)time arguments:(NSDictionary *)arguments
{
GLdouble depth;
CGLContextObj cgl_ctx = [context CGLContextObj];
glGetDoublev(GL_DEPTH_CLEAR_VALUE, &depth);
glClearDepth([inputDepth doubleValue]);
glClear(GL_DEPTH_BUFFER_BIT);
glClearDepth(depth);
return YES;
}
@end