@Override public boolean texture2DIsBoundAnywhere(final JCGLTexture2DUsableType texture) throws JCGLException { FakeTextures.checkTexture2D(this.context, texture); final int texture_id = texture.getGLName(); return this.texture_to_units.containsKey(texture_id); }
@Override public boolean texture2DIsBoundAnywhere(final JCGLTexture2DUsableType texture) throws JCGLException { LWJGL3Textures.checkTexture2D(this.context, texture); final int texture_id = texture.getGLName(); return this.texture_to_units.containsKey(texture_id); }
@Override public Unit onTexture2D(final JCGLTexture2DUsableType t) throws JCGLException { if (LWJGL3Framebuffers.LOG.isDebugEnabled()) { LWJGL3Framebuffers.LOG.debug( "[{}] attach color {} {}", Integer.valueOf(f_id), Integer.valueOf(index), t); } LWJGL3Textures.checkTexture2D(c, t); final JCGLTextureFormat f = t.textureGetFormat(); JCGLTextureFormats.checkColorRenderableTexture2D(f); GL30.glFramebufferTexture2D( GL30.GL_DRAW_FRAMEBUFFER, GL30.GL_COLOR_ATTACHMENT0 + index, GL11.GL_TEXTURE_2D, t.getGLName(), 0); return Unit.unit(); }
@Override public Unit onTexture2D( final JCGLTexture2DUsableType t) throws JCGLException { if (LWJGL3Framebuffers.LOG.isDebugEnabled()) { LWJGL3Framebuffers.LOG.debug( "[{}] attach depth {}", Integer.valueOf(f_id), t); } final JCGLTextureFormat f = t.textureGetFormat(); LWJGL3Textures.checkTexture2D(c, t); JCGLTextureFormats.checkDepthOnlyRenderableTexture2D(f); GL30.glFramebufferTexture2D( GL30.GL_DRAW_FRAMEBUFFER, GL30.GL_DEPTH_ATTACHMENT, GL11.GL_TEXTURE_2D, t.getGLName(), 0); fb.setDepthAttachment(t, JCGLTextureFormats.getDepthBits(f)); return Unit.unit(); } });
LWJGL3Textures.checkTextureUnit(this.context, unit); final int index = unit.unitGetIndex(); final int texture_id = texture.getGLName();
@Override public void texture2DBind( final JCGLTextureUnitType unit, final JCGLTexture2DUsableType texture) throws JCGLException { final FakeTexture2D t = FakeTextures.checkTexture2D(this.context, texture); final FakeTextureUnit u = FakeTextures.checkTextureUnit(this.context, unit); this.checkFeedback(texture); final int index = unit.unitGetIndex(); final int texture_id = texture.getGLName(); this.textureUnitUnbind(unit); FakeTextures.LOG.trace( "bind 2D [{}]: none -> {}", Integer.valueOf(index), texture); this.bindingAddTextureReference(texture_id, index); u.setBind2D(t); }
@Override public Unit onTexture2D(final JCGLTexture2DUsableType t) throws JCGLException { if (LWJGL3Framebuffers.LOG.isDebugEnabled()) { LWJGL3Framebuffers.LOG.debug( "[{}] attach depth+stencil {}", Integer.valueOf(f_id), t); } LWJGL3Textures.checkTexture2D(c, t); final JCGLTextureFormat f = t.textureGetFormat(); JCGLTextureFormats.checkDepthStencilRenderableTexture2D(f); GL30.glFramebufferTexture2D( GL30.GL_DRAW_FRAMEBUFFER, GL30.GL_DEPTH_STENCIL_ATTACHMENT, GL11.GL_TEXTURE_2D, t.getGLName(), 0); fb.setDepthStencilAttachment( t, JCGLTextureFormats.getDepthBits(f), JCGLTextureFormats.getStencilBits(f)); return Unit.unit(); } });