@Override public JCGLTexture2DUpdateType getTextureUpdate2D( final JCGLTexture2DUsableType t, final JCGLTLTextureDataType data) { final JCGLTexture2DUpdateType u = JCGLTextureUpdates.newUpdateReplacingAll2D(t); final int tw = (int) t.textureGetWidth(); final int th = (int) t.textureGetHeight(); final long dw = data.getWidth(); final long dh = data.getHeight(); RangeCheck.checkGreaterEqualLong( (long) tw, "Texture width", dw, "Data width"); RangeCheck.checkGreaterEqualLong( (long) th, "Texture height", dh, "Data height"); JCGLTLTextureUpdateProvider.populate( t.textureGetFormat(), data, u.getData(), tw, th); return u; }
@Test public final void testTexture() { final JCGLContextType c = this.newGL33Context("main", 24, 8); final JCGLInterfaceGL33Type gi = c.contextGetGL33(); final JCGLTexturesType gt = gi.getTextures(); final JCGLTextureUnitAllocatorType tc = JCGLTextureUnitAllocator.newAllocatorWithStack(32, gt.textureGetUnits()); final R2Texture2DType tt = R2SSAONoiseTexture.newNoiseTexture(gt, tc.getRootContext()); final JCGLTexture2DUsableType t = tt.texture(); Assert.assertEquals(64L, t.textureGetWidth()); Assert.assertEquals(64L, t.textureGetWidth()); Assert.assertEquals( JCGLTextureFormat.TEXTURE_FORMAT_RGB_8_3BPP, t.textureGetFormat()); } }
values.stippleNoiseTexture().texture(); this.noise_uv_scale.set2F( (float) (this.viewport_w / noise.textureGetWidth()), (float) (this.viewport_h / noise.textureGetHeight()));
values.stippleNoiseTexture().texture(); this.noise_uv_scale.set2F( (float) (this.viewport_w / noise.textureGetWidth()), (float) (this.viewport_h / noise.textureGetHeight()) );