From 8398ea676807dcba4bd41aa70843875d8a7b44a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Renaudeau?= Date: Tue, 8 Sep 2015 15:58:05 +0200 Subject: [PATCH] Implement 'preload' props for #3 --- Examples/Tests/Display2.js | 3 ++- Examples/Tests/index.js | 2 +- src/GLCanvas.js | 48 +++++++++++++++++++++++++++----------- src/GLImage.js | 2 +- src/View.js | 10 ++------ 5 files changed, 40 insertions(+), 25 deletions(-) diff --git a/Examples/Tests/Display2.js b/Examples/Tests/Display2.js index 5e2aa0b..bf83126 100644 --- a/Examples/Tests/Display2.js +++ b/Examples/Tests/Display2.js @@ -10,11 +10,12 @@ const shaders = GL.Shaders.create({ class Display2 extends GL.Component { render () { - const { width, height, children, vertical } = this.props; + const { width, height, children, vertical, ...rest } = this.props; if (!children || children.length !== 2) throw new Error("You must provide 2 children to Display2"); let [t1, t2] = children; if (vertical) [t1,t2]=[t2,t1]; // just because webgl y's is reversed return ; - return + return {txt} diff --git a/src/GLCanvas.js b/src/GLCanvas.js index 2642e6a..c489e63 100644 --- a/src/GLCanvas.js +++ b/src/GLCanvas.js @@ -27,6 +27,18 @@ function syncShape (obj, shape) { } } +function imageObjectToId (image) { + return image.uri; +} + +function allPreloaded (loaded, toLoad) { + for (let i=0; i 0 ? [] : null; } render () { - const { width, height, style } = this.props; + const { width, height } = this.props; const { scale } = this.state; const styles = { - ...style, width: width+"px", height: height+"px" }; return { this._loading = null; this.clearImage(); diff --git a/src/View.js b/src/View.js index e5f20c0..43a1605 100644 --- a/src/View.js +++ b/src/View.js @@ -18,14 +18,8 @@ const renderVcontent = function (width, height, id, children) { return
{content}
; }; -const renderVGL = function (props, width, height, data, nbUniforms) { - return ; +const renderVGL = function (props) { + return ; }; const renderVcontainer = function (style, width, height, contents, renderer) {