GLShader.h 629 Bytes
Newer Older
Gaëtan Renaudeau's avatar
Gaëtan Renaudeau committed
1 2 3 4 5 6 7 8 9 10 11 12 13
#import <GLKit/GLKit.h>
#import "RCTBridgeModule.h"

@interface GLShader: NSObject

@property EAGLContext *context;
@property NSString *vert;
@property NSString *frag;
@property NSDictionary *uniformTypes;

/**
 * Create a new shader with a vertex and fragment
 */
14
- (instancetype)initWithContext: (EAGLContext*)context withName:(NSString *)name withVert:(NSString *)vert withFrag:(NSString *)frag;
Gaëtan Renaudeau's avatar
Gaëtan Renaudeau committed
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31

/**
 * Bind the shader program as the current one
 */
- (void) bind;

/**
 * Check the shader validity
 */
- (void) validate;

/**
 * Set the value of an uniform
 */
- (void) setUniform: (NSString *)name withValue:(id)obj;

@end