Commit 06ac7c0f authored by Gaëtan Renaudeau's avatar Gaëtan Renaudeau

Fixes #30

parent b5cf9192
...@@ -29,6 +29,23 @@ RCT_EXPORT_VIEW_PROPERTY(onLoad, BOOL); ...@@ -29,6 +29,23 @@ RCT_EXPORT_VIEW_PROPERTY(onLoad, BOOL);
RCT_EXPORT_VIEW_PROPERTY(onProgress, BOOL); RCT_EXPORT_VIEW_PROPERTY(onProgress, BOOL);
RCT_EXPORT_VIEW_PROPERTY(onChange, BOOL); RCT_EXPORT_VIEW_PROPERTY(onChange, BOOL);
/* TODO
RCT_EXPORT_METHOD(capture:
(nonnull NSNumber *)reactTag
callback:(RCTResponseSenderBlock)callback)
{
UIView *view = [self.bridge.uiManager viewForReactTag:reactTag];
if ([view isKindOfClass:[GLCanvas class]]) {
[((GLCanvas*)view) capture: callback];
}
else {
callback(@[@"view is not a GLCanvas"]);
}
}
*/
- (UIView *)view - (UIView *)view
{ {
GLCanvas * v; GLCanvas * v;
......
...@@ -32,8 +32,8 @@ ...@@ -32,8 +32,8 @@
- (void)restore - (void)restore
{ {
glBindFramebuffer(GL_FRAMEBUFFER, _fbo); glBindFramebuffer(GL_FRAMEBUFFER, _fbo);
glBindRenderbuffer(GL_FRAMEBUFFER, _rbo); glBindRenderbuffer(GL_RENDERBUFFER, _rbo);
glBindTexture(GL_FRAMEBUFFER, _tex); glBindTexture(GL_TEXTURE_2D, _tex);
} }
@end @end
...@@ -128,8 +128,8 @@ GLuint initRenderBuffer (float width, float height, GLuint component, GLuint att ...@@ -128,8 +128,8 @@ GLuint initRenderBuffer (float width, float height, GLuint component, GLuint att
if (width == _width && height == _height) return; if (width == _width && height == _height) return;
GLint maxFBOSize; GLint maxFBOSize;
glGetIntegerv(GL_MAX_RENDERBUFFER_SIZE, &maxFBOSize); glGetIntegerv(GL_MAX_RENDERBUFFER_SIZE, &maxFBOSize);
if( _width < 0 || _width > maxFBOSize || if( width < 0 || width > maxFBOSize ||
_height < 0 || _height > maxFBOSize) { height < 0 || height > maxFBOSize) {
RCTLogError(@"Can't resize framebuffer. Invalid dimensions"); RCTLogError(@"Can't resize framebuffer. Invalid dimensions");
return; return;
} }
......
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