@Override public Unit onTextureCube( final JCGLTextureCubeUsableType t, final JCGLCubeMapFaceLH face) throws JCGLException, UnreachableCodeException { 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.format(); JCGLTextureFormats.checkColorRenderableTexture2D(f); return Unit.unit(); } });
final int bpp = t.format().getBytesPerPixel(); final long size = width * height * (long) bpp;
@Override public Unit onTextureCube( final JCGLTextureCubeUsableType t, final JCGLCubeMapFaceLH face) throws JCGLException, UnreachableCodeException { if (LOG.isDebugEnabled()) { LOG.debug( "[{}] attach color {} {} (face {})", Integer.valueOf(f_id), Integer.valueOf(index), t, face); } LWJGL3Textures.checkTextureCube(c, t); final JCGLTextureFormat f = t.format(); JCGLTextureFormats.checkColorRenderableTexture2D(f); final int gface = LWJGL3TypeConversions.cubeFaceToGL(face); GL30.glFramebufferTexture2D( GL30.GL_DRAW_FRAMEBUFFER, GL30.GL_COLOR_ATTACHMENT0 + index, gface, t.glName(), 0); return Unit.unit(); } });
@Override public void attachColorTextureCubeAt( final JCGLFramebufferColorAttachmentPointType point, final JCGLFramebufferDrawBufferType buffer, final JCGLTextureCubeUsableType texture, final JCGLCubeMapFaceLH face) { NullCheck.notNull(point, "Point"); NullCheck.notNull(face, "Face"); checkColorAttachmentPoint(this.context, point); checkDrawBuffer(this.context, buffer); FakeTextures.checkTextureCube(this.context, texture); JCGLTextureFormats.checkColorRenderableTexture2D( texture.format()); this.color_attaches.set( point.colorAttachmentPointIndex(), 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, "Point"); NullCheck.notNull(face, "Face"); checkColorAttachmentPoint(this.context, point); checkDrawBuffer(this.context, buffer); LWJGL3Textures.checkTextureCube(this.context, texture); JCGLTextureFormats.checkColorRenderableTexture2D( texture.format()); this.color_attaches.set( point.colorAttachmentPointIndex(), new CubeAttachment(texture, face)); this.draw_buffers.put(buffer, point); }
@Override public JCGLTextureCubeUpdateType createTextureUpdateCube( final JCGLTextureCubeUsableType t, final JCGLTLTextureDataType data) { final JCGLTextureCubeUpdateType u = JCGLTextureUpdates.newUpdateReplacingAllCube(t); final int tw = (int) t.width(); final long dw = data.width(); RangeCheck.checkGreaterEqualLong( (long) tw, "Texture size", dw, "Data size"); populate( t.format(), data, u.data(), tw, tw); return u; }
checkTextureCube(this.context, texture); final JCGLTextureFormat format = texture.format(); final LWJGL3TextureSpec spec = LWJGL3TextureSpecs.getTextureSpec(format);
final int height = Math.toIntExact(update_area.height()); final JCGLTextureFormat format = texture.format(); final LWJGL3TextureSpec spec = LWJGL3TextureSpecs.getTextureSpec(format); final ByteBuffer buffer = data.data();
final int bpp = texture.format().getBytesPerPixel(); copyBytes( bpp,