- Timestamp:
- 08/05/2008 07:44:31 PM (5 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
development/java/field/graphics/core/AdvancedTextures.java
r76 r145 54 54 } 55 55 56 public Base1ByteTexture allwaysDirty() 57 { 58 allwaysDirty = true; 59 return this; 60 } 61 62 boolean allwaysDirty = false; 63 56 64 public Base1ByteTexture setTextureRange(TextureRange in) { 57 65 this.in = in; … … 82 90 assert gl.glGetError() == 0; 83 91 92 if (allwaysDirty) 93 dirty = true; 94 84 95 if (dirty) { 96 System.out.println(" pixel buffer is <"+pixelBuffer+">"); 97 pixelBuffer.rewind(); 85 98 gl.glTexSubImage2D(gl.GL_TEXTURE_RECTANGLE_EXT, 0, 0, 0, width, height, gl.GL_LUMINANCE, gl.GL_UNSIGNED_BYTE, pixelBuffer); 86 99 // gl.glTexSubImage2D(gl.GL_TEXTURE_RECTANGLE_EXT, 0, 0, 0, width, height, gl.GL_BGRA, gl.GL_UNSIGNED_INT_8_8_8_8_REV, pixelBuffer); … … 239 252 } 240 253 254 public Base3ByteTexture allwaysDirty() 255 { 256 allwaysDirty = true; 257 return this; 258 } 259 260 boolean allwaysDirty = false; 261 241 262 @Override 242 263 public void post() { … … 261 282 assert gl.glGetError() == 0; 262 283 284 if (allwaysDirty) 285 dirty = true; 286 263 287 if (dirty) { 288 pixelBuffer.rewind(); 264 289 gl.glTexSubImage2D(this.textureTarget, 0, 0, 0, width, height, gl.GL_RGB, gl.GL_UNSIGNED_BYTE, pixelBuffer); 265 290 // gl.glTexSubImage2D(this.textureTarget, 0, 0, 0, width, height, gl.GL_BGRA, gl.GL_UNSIGNED_INT_8_8_8_8_REV, pixelBuffer); … … 429 454 super(name); 430 455 } 456 public BaseFastRawTexture allwaysDirty() 457 { 458 allwaysDirty = true; 459 return this; 460 } 461 462 boolean allwaysDirty = false; 463 431 464 432 465 public void deallocate(TaskQueue atRenderTime) { … … 464 497 if (in != null) in.declareNow(gl); 465 498 499 if (allwaysDirty) 500 dirty = true; 501 466 502 if (dirty) gl.glTexSubImage2D(gl.GL_TEXTURE_RECTANGLE_EXT, 0, 0, 0, width, height, gl.GL_BGRA, gl.GL_UNSIGNED_INT_8_8_8_8_REV, from); 467 503 // if (dirty) gl.glTexSubImage2D(gl.GL_TEXTURE_RECTANGLE_EXT, 0, 0, 0, width, height, gl.GL_RGBA, gl.GL_UNSIGNED_INT_8_8_8_8, from);