OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2010, Google Inc. | 2 * Copyright 2010, Google Inc. |
3 * All rights reserved. | 3 * All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
204 texture.width = width; | 204 texture.width = width; |
205 texture.height = height; | 205 texture.height = height; |
206 texture.levels = levels; | 206 texture.levels = levels; |
207 texture.texture_ = this.gl.createTexture(); | 207 texture.texture_ = this.gl.createTexture(); |
208 texture.texture_target_ = this.gl.TEXTURE_2D; | 208 texture.texture_target_ = this.gl.TEXTURE_2D; |
209 | 209 |
210 if (width != undefined && height != undefined) { | 210 if (width != undefined && height != undefined) { |
211 this.gl.bindTexture(this.gl.TEXTURE_2D, texture.texture_); | 211 this.gl.bindTexture(this.gl.TEXTURE_2D, texture.texture_); |
212 this.gl.texImage2D(this.gl.TEXTURE_2D, 0, this.gl.RGBA, width, height, | 212 this.gl.texImage2D(this.gl.TEXTURE_2D, 0, this.gl.RGBA, width, height, |
213 0, this.gl.RGBA, this.gl.UNSIGNED_BYTE, null); | 213 0, this.gl.RGBA, this.gl.UNSIGNED_BYTE, null); |
214 texture.setupRepeatModes_(width, height); | |
214 } | 215 } |
215 | 216 |
216 this.gl.bindTexture(this.gl.TEXTURE_2D, texture.texture_); | 217 this.gl.bindTexture(this.gl.TEXTURE_2D, texture.texture_); |
petersont
2010/04/28 22:24:17
I will fix this differently in a cl I'm working on
| |
217 this.gl.texParameteri(this.gl.TEXTURE_2D, | 218 this.gl.texParameteri(this.gl.TEXTURE_2D, |
218 this.gl.TEXTURE_MAG_FILTER, this.gl.LINEAR); | 219 this.gl.TEXTURE_MAG_FILTER, this.gl.LINEAR); |
219 this.gl.texParameteri(this.gl.TEXTURE_2D, | 220 this.gl.texParameteri(this.gl.TEXTURE_2D, |
220 this.gl.TEXTURE_MIN_FILTER, this.gl.LINEAR); | 221 this.gl.TEXTURE_MIN_FILTER, this.gl.LINEAR); |
221 this.gl.texParameteri(this.gl.TEXTURE_2D, | |
222 this.gl.TEXTURE_WRAP_S, this.gl.CLAMP_TO_EDGE); | |
223 this.gl.texParameteri(this.gl.TEXTURE_2D, | |
224 this.gl.TEXTURE_WRAP_T, this.gl.CLAMP_TO_EDGE); | |
225 | 222 |
226 return texture; | 223 return texture; |
227 }; | 224 }; |
228 | 225 |
229 | 226 |
230 /** | 227 /** |
231 * Creates a new TextureCUBE object of the specified size and format and | 228 * Creates a new TextureCUBE object of the specified size and format and |
232 * reserves the necessary resources for it. | 229 * reserves the necessary resources for it. |
233 * Note: If enable_render_surfaces is true, then the dimensions must be a | 230 * Note: If enable_render_surfaces is true, then the dimensions must be a |
234 * power of two. | 231 * power of two. |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
433 /** | 430 /** |
434 * Create RawData given a data URL. | 431 * Create RawData given a data URL. |
435 * @param {string} data_url The data URL from which to create the RawData. | 432 * @param {string} data_url The data URL from which to create the RawData. |
436 * @return {!o3d.RawData} The RawData. | 433 * @return {!o3d.RawData} The RawData. |
437 */ | 434 */ |
438 o3d.Pack.prototype.createRawDataFromDataURL = | 435 o3d.Pack.prototype.createRawDataFromDataURL = |
439 function(data_url) { | 436 function(data_url) { |
440 o3d.notImplemented(); | 437 o3d.notImplemented(); |
441 }; | 438 }; |
442 | 439 |
OLD | NEW |