Commit d2fc5e51 authored by Gaëtan Renaudeau's avatar Gaëtan Renaudeau

Remove dead code in iOS implementation

Fixes https://github.com/ProjectSeptemberInc/gl-react-native/issues/71
parent 71a86720
...@@ -47,17 +47,6 @@ GLTexture *initTexture (float width, float height, GLuint attachment) ...@@ -47,17 +47,6 @@ GLTexture *initTexture (float width, float height, GLuint attachment)
return texture; return texture;
} }
GLuint initRenderBuffer (float width, float height, GLuint component, GLuint attachment)
{
GLuint handle;
glGenRenderbuffers(1, &handle);
glBindRenderbuffer(GL_RENDERBUFFER, handle);
glRenderbufferStorage(GL_RENDERBUFFER, component, width, height);
glFramebufferRenderbuffer(GL_FRAMEBUFFER, attachment, GL_RENDERBUFFER, handle);
return handle;
}
@implementation GLFBO @implementation GLFBO
{ {
GLuint _handle; GLuint _handle;
......
...@@ -45,42 +45,6 @@ RCT_EXPORT_MODULE() ...@@ -45,42 +45,6 @@ RCT_EXPORT_MODULE()
return _context; return _context;
} }
- (void)_addShader:(nonnull NSNumber *)id
withConfig:(NSDictionary *)config
withOnCompile:(RCTResponseSenderBlock)onCompile
{
NSString *vert = [RCTConvert NSString:config[@"vert"]];
NSString *frag = [RCTConvert NSString:config[@"frag"]];
NSString *name = [RCTConvert NSString:config[@"name"]];
if (!vert) {
vert = fullViewportVert;
}
if (!frag) {
RCTLogError(@"Shader '%@': missing frag field", name);
return;
}
GLShader *shader = [[GLShader alloc] initWithContext:_context withName:name withVert:vert withFrag:frag];
NSError *error;
bool success = [shader ensureCompiles:&error];
if (onCompile) {
if (!success) {
onCompile(@[error.domain]);
}
else {
onCompile(@[[NSNull null],
@{
@"uniforms": shader.uniformTypes
}]);
}
}
else {
if (!success) {
RCTLogError(@"Shader '%@': %@", name, error.domain);
}
}
_shaders[id] = shader;
}
static NSString* fullViewportVert = @"attribute vec2 position;varying vec2 uv;void main() {gl_Position = vec4(position,0.0,1.0);uv = vec2(0.5, 0.5) * (position+vec2(1.0, 1.0));}"; static NSString* fullViewportVert = @"attribute vec2 position;varying vec2 uv;void main() {gl_Position = vec4(position,0.0,1.0);uv = vec2(0.5, 0.5) * (position+vec2(1.0, 1.0));}";
NSString* glTypeString (int type) { NSString* glTypeString (int type) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment