Commit 18087d5
committed
Fix all image to texture loading to not generate warnings
All images load asynchronously which means either you should
not start rendering until they are loaded or else you need
to put something in the textures so you can render immediately.
This patch initializes all textures to a 1x1 pixel blue texture.
When the image finishes loading the code replaces that contents
of that texture with the image. Until then it's free to render
with the one pixel texture
This gets rid of the rendering warnings from the browser in
the JavaScript console.1 parent 8544709 commit 18087d5
File tree
18 files changed
+94
-25
lines changed- example01
- example02
- example03
- lesson05
- lesson06
- lesson07
- lesson08
- lesson09
- lesson10
- lesson11
- lesson12
- lesson13
- lesson14
- lesson15
- lesson16
18 files changed
+94
-25
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
212 | 212 | | |
213 | 213 | | |
214 | 214 | | |
215 | | - | |
| 215 | + | |
216 | 216 | | |
217 | 217 | | |
218 | 218 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
338 | 338 | | |
339 | 339 | | |
340 | 340 | | |
341 | | - | |
| 341 | + | |
342 | 342 | | |
343 | 343 | | |
344 | 344 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
150 | | - | |
151 | 150 | | |
152 | | - | |
153 | | - | |
154 | 151 | | |
155 | | - | |
| 152 | + | |
156 | 153 | | |
157 | 154 | | |
158 | 155 | | |
159 | | - | |
160 | 156 | | |
161 | 157 | | |
162 | 158 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
150 | | - | |
151 | 150 | | |
152 | | - | |
153 | | - | |
154 | 151 | | |
155 | | - | |
| 152 | + | |
156 | 153 | | |
157 | 154 | | |
158 | 155 | | |
159 | | - | |
160 | 156 | | |
161 | 157 | | |
162 | 158 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
160 | | - | |
161 | 160 | | |
162 | | - | |
163 | | - | |
164 | 161 | | |
165 | | - | |
| 162 | + | |
166 | 163 | | |
167 | 164 | | |
168 | 165 | | |
169 | | - | |
170 | 166 | | |
171 | 167 | | |
172 | 168 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
119 | | - | |
| 119 | + | |
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
| |||
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
160 | | - | |
161 | 160 | | |
162 | | - | |
163 | | - | |
164 | 161 | | |
165 | | - | |
| 162 | + | |
166 | 163 | | |
167 | 164 | | |
168 | 165 | | |
169 | | - | |
170 | 166 | | |
171 | 167 | | |
172 | 168 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
133 | 138 | | |
134 | 139 | | |
135 | 140 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
149 | 154 | | |
150 | 155 | | |
151 | 156 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
164 | | - | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
165 | 170 | | |
166 | 171 | | |
167 | 172 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
166 | 171 | | |
167 | 172 | | |
168 | 173 | | |
| |||
0 commit comments