@Override public Unit onTextureCube( final JCGLTextureCubeUsableType t, final JCGLCubeMapFaceLH face) throws JCGLException, UnreachableCodeException { FakeFramebuffers.LOG.debug( "[{}] attach {} (face {}) at color {}", Integer.valueOf(f_id), t, face, Integer.valueOf(index)); FakeTextures.checkTextureCube(FakeFramebuffers.this.context, t); final JCGLTextureFormat f = t.textureGetFormat(); JCGLTextureFormats.checkColorRenderableTexture2D(f); return Unit.unit(); } });
@Override public Unit onTextureCube( final JCGLTextureCubeUsableType t, final JCGLCubeMapFaceLH face) throws JCGLException, UnreachableCodeException { if (LWJGL3Framebuffers.LOG.isDebugEnabled()) { LWJGL3Framebuffers.LOG.debug( "[{}] attach color {} {} (face {})", Integer.valueOf(f_id), Integer.valueOf(index), t, face); } LWJGL3Textures.checkTextureCube(c, t); final JCGLTextureFormat f = t.textureGetFormat(); JCGLTextureFormats.checkColorRenderableTexture2D(f); final int gface = LWJGL3TypeConversions.cubeFaceToGL(face); GL30.glFramebufferTexture2D( GL30.GL_DRAW_FRAMEBUFFER, GL30.GL_COLOR_ATTACHMENT0 + index, gface, t.getGLName(), 0); return Unit.unit(); } });
@Override public void attachColorTextureCubeAt( final JCGLFramebufferColorAttachmentPointType point, final JCGLFramebufferDrawBufferType buffer, final JCGLTextureCubeUsableType texture, final JCGLCubeMapFaceLH face) { NullCheck.notNull(point); NullCheck.notNull(face); LWJGL3Framebuffers.checkColorAttachmentPoint(this.context, point); LWJGL3Framebuffers.checkDrawBuffer(this.context, buffer); LWJGL3Textures.checkTextureCube(this.context, texture); JCGLTextureFormats.checkColorRenderableTexture2D( texture.textureGetFormat()); this.color_attaches.set( point.colorAttachmentPointGetIndex(), new CubeAttachment(texture, face)); this.draw_buffers.put(buffer, point); }
@Override public void attachColorTextureCubeAt( final JCGLFramebufferColorAttachmentPointType point, final JCGLFramebufferDrawBufferType buffer, final JCGLTextureCubeUsableType texture, final JCGLCubeMapFaceLH face) { NullCheck.notNull(point); NullCheck.notNull(face); FakeFramebuffers.checkColorAttachmentPoint(this.context, point); FakeFramebuffers.checkDrawBuffer(this.context, buffer); FakeTextures.checkTextureCube(this.context, texture); JCGLTextureFormats.checkColorRenderableTexture2D( texture.textureGetFormat()); this.color_attaches.set( point.colorAttachmentPointGetIndex(), new CubeAttachment(texture, face)); this.draw_buffers.put(buffer, point); }
@Override public JCGLTextureCubeUpdateType getTextureUpdateCube( final JCGLTextureCubeUsableType t, final JCGLTLTextureDataType data) { final JCGLTextureCubeUpdateType u = JCGLTextureUpdates.newUpdateReplacingAllCube(t); final int tw = (int) t.textureGetWidth(); final long dw = data.getWidth(); RangeCheck.checkGreaterEqualLong( (long) tw, "Texture size", dw, "Data size"); JCGLTLTextureUpdateProvider.populate( t.textureGetFormat(), data, u.getData(), tw, tw); return u; }
final int bpp = t.textureGetFormat().getBytesPerPixel(); final long size = width * height * (long) bpp;
@Override public ByteBuffer textureCubeGetImageLH( final JCGLTextureUnitType unit, final JCGLCubeMapFaceLH face, final JCGLTextureCubeUsableType texture) throws JCGLException { NullCheck.notNull(texture); NullCheck.notNull(face); NullCheck.notNull(unit); LWJGL3Textures.checkTextureUnit(this.context, unit); LWJGL3Textures.checkTextureCube(this.context, texture); final JCGLTextureFormat format = texture.textureGetFormat(); final LWJGL3TextureSpec spec = LWJGL3TextureSpecs.getTextureSpec(format); final AreaInclusiveUnsignedLType area = texture.textureGetArea(); final long width = area.getRangeX().getInterval(); final long height = area.getRangeY().getInterval(); final ByteBuffer data = ByteBuffer.allocateDirect( (int) (width * height * (long) format.getBytesPerPixel())); data.order(ByteOrder.nativeOrder()); final int gface = LWJGL3TypeConversions.cubeFaceToGL(face); this.textureCubeBind(unit, texture); GL11.glGetTexImage( gface, 0, spec.getFormat(), spec.getType(), data); return data; }
final long target_width = target_range_x.getInterval(); final int bpp = texture.textureGetFormat().getBytesPerPixel(); FakeTextures.copyBytes( bpp,
final int width = (int) update_area.getRangeX().getInterval(); final int height = (int) update_area.getRangeY().getInterval(); final JCGLTextureFormat format = texture.textureGetFormat(); final LWJGL3TextureSpec spec = LWJGL3TextureSpecs.getTextureSpec(format); final ByteBuffer buffer = data.getData();