static JCGLTexture2DType newTexture2D( final JCGLInterfaceGL33Type g, final JCGLTextureFormat f, final int w, final int h, final JCGLTextureUnitType u) { final JCGLTexturesType gt = g.getTextures(); final JCGLTexture2DType t = gt.texture2DAllocate( u, (long) w, (long) h, f, JCGLTextureWrapS.TEXTURE_WRAP_CLAMP_TO_EDGE, JCGLTextureWrapT.TEXTURE_WRAP_CLAMP_TO_EDGE, JCGLTextureFilterMinification.TEXTURE_FILTER_NEAREST, JCGLTextureFilterMagnification.TEXTURE_FILTER_NEAREST); final JCGLTexture2DUpdateType up = JCGLTextureUpdates.newUpdateReplacingAll2D(t); final ByteBuffer data = up.getData(); for (int index = 0; index < data.capacity(); ++index) { data.put(index, (byte) 0); } gt.texture2DUpdate(u, up); gt.textureUnitUnbind(u); return t; } }
Assert.assertEquals(expected_area, up.getArea()); final ByteBuffer data = up.getData(); final long expected_size = 128L * 256L * 4L; Assert.assertEquals(expected_size, (long) data.capacity());
final ByteBuffer data = up.getData(); Assert.assertEquals(512L * 512L * 4L, (long) data.capacity()); for (int index = 0; index < data.capacity(); ++index) {
Assert.assertEquals(expected_area, up.getArea()); final ByteBuffer data = up.getData(); final long expected_size = 128L * 128L; Assert.assertEquals(expected_size, (long) data.capacity());
final ByteBuffer data = up.getData(); Assert.assertEquals(512L * 512L * 2L, (long) data.capacity()); for (int index = 0; index < data.capacity(); ++index) {
final ByteBuffer data = up.getData(); for (int index = 0; index < data.capacity(); ++index) { data.put(index, (byte) 0xff);
final ByteBuffer data = up.getData(); Assert.assertEquals(512L * 512L * 3L, (long) data.capacity()); for (int index = 0; index < data.capacity(); ++index) {
final ByteBuffer data = up.getData(); Assert.assertEquals(512L * 512L * 2L, (long) data.capacity()); for (int index = 0; index < data.capacity(); ++index) { final ByteBuffer data = up.getData(); Assert.assertEquals(128L * 128L * 2L, (long) data.capacity()); for (int index = 0; index < data.capacity(); index += 2) {
final ByteBuffer data = up.getData(); Assert.assertEquals(512L * 512L * 3L, (long) data.capacity()); for (int index = 0; index < data.capacity(); ++index) { final ByteBuffer data = up.getData(); Assert.assertEquals(128L * 128L * 3L, (long) data.capacity()); for (int index = 0; index < data.capacity(); index += 3) {
final ByteBuffer data = this.texture_update.getData(); for (int index = 0; index < data.capacity(); ++index) { data.put(index, (byte) random.nextInt(0xff));
final ByteBuffer data = up.getData(); Assert.assertEquals(512L * 512L * 4L, (long) data.capacity()); for (int index = 0; index < data.capacity(); ++index) { final ByteBuffer data = up.getData(); Assert.assertEquals(128L * 128L * 4L, (long) data.capacity()); for (int index = 0; index < data.capacity(); index += 4) {
final ByteBuffer data = this.texture_update.getData(); for (int index = 0; index < data.capacity(); ++index) { data.put(index, (byte) random.nextInt(0xff));
@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; }
expected_contents = up.getData(); for (int index = 0; index < expected_contents.capacity(); ++index) { expected_contents.put(index, (byte) (Math.random() * 0xff));
final JPRACursor2DType<JCGLR8Type> c = JPRACursor2DByteBufferedUnchecked.newCursor( tu.getData(), (int) size, (int) size,
final JCGLTexture2DUpdateType up = JCGLTextureUpdates.newUpdateReplacingAll2D(t); final ByteBuffer d = up.getData(); final JPRACursor2DType<JCGLRGB8Type> c = JPRACursor2DByteBufferedUnchecked.newCursor(
final JCGLTexture2DUpdateType up = JCGLTextureUpdates.newUpdateReplacingAll2D(t); final ByteBuffer d = up.getData(); final JPRACursor2DType<JCGLRGB8Type> c = JPRACursor2DByteBufferedUnchecked.newCursor(
final long source_min_y = source_range_y.getLower(); final long source_height = source_range_y.getInterval(); final ByteBuffer source_data = data.getData();
final JCGLTextureFormat format = texture.textureGetFormat(); final LWJGL3TextureSpec spec = LWJGL3TextureSpecs.getTextureSpec(format); final ByteBuffer buffer = data.getData();