From 5c6770c8b5962cf72bc362fd7bd3348f69fb15d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Renaudeau?= Date: Wed, 9 Sep 2015 15:14:38 +0200 Subject: [PATCH] update docs --- docs/api/{Target.md => Uniform.md} | 6 +++++- docs/api/View.md | 7 ++++--- 2 files changed, 9 insertions(+), 4 deletions(-) rename docs/api/{Target.md => Uniform.md} (85%) diff --git a/docs/api/Target.md b/docs/api/Uniform.md similarity index 85% rename from docs/api/Target.md rename to docs/api/Uniform.md index 06ef0aa..4a67cad 100644 --- a/docs/api/Target.md +++ b/docs/api/Uniform.md @@ -1,6 +1,10 @@ # GL.Uniform -`GL.Uniform` allows to render a shader with any content. It can be an image, a video, a complex content (including texts and images...) or even another `GL.Component` (which allows to **compose and stack effects**). +`GL.Uniform` is an helper for describing content uniform. + +GL.View allows uniform VDOM content: It can be an image, a video, a complex content (including texts and images...) or even another `GL.Component` (which allows to **compose and stack effects**). + +> `{value}` is an alternative syntax to passing `{ foo: value }` in parent `GL.View` uniforms props. It is just more convenient for VDOM uniform value. **Example:** diff --git a/docs/api/View.md b/docs/api/View.md index 540cc96..d07ad98 100644 --- a/docs/api/View.md +++ b/docs/api/View.md @@ -60,14 +60,15 @@ render () { - **`width`** and **`height`** *(Number)* **(required)**: the size of the view. - **`uniforms`** *(object)*: an object that contains all uniform parameters to send to the shader. The key is the uniform name and the value is whatever value that makes sense for the uniform's type (see below). - **`opaque`** *(bool)*: specify if the view should be opaque. By default, it is true, meaning that the GL View won't support texture opacity and alpha channel. -- **...any other props** get directly passed to the underlying view. +- **`preload`** *(bool)*: specify if the view should initially not render until all images are loaded. `false` by default, this behavior should be explicitly enabled. +- **...any other props** get directly passed to the underlying view. *(this feature is deprecated and will eventually be removed. Prefer using a container on top for things like events and styles)* ## Uniform types -Here is the correspondance of GLSL and JavaScript types. +Here is the correspondence of GLSL and JavaScript types. - `int`, `float`, `bool` : Number (e.g: `42`). -- `sampler2D` : either the image URL (String) OR an Object with an `uri` (in React Native, `require("image!id")` is also supported, the format is then exactly like the `source` prop of `React.Image`). +- `sampler2D` : either the image URL (String) OR an Object with an `uri` (in React Native, `require("image!id")` is also supported, the format is then exactly like the `source` prop of `React.Image`). Virtual DOM is also allowed, see [GL.Uniform][Uniform.md] for more information. - `vecN`,`ivecN`,`bvecN` where N is {2,3,4} : an array of N Number (e.g: `[1, 2, 3.5]` for a `vec3`). - `matN` : an array of N*N Number.