-
Notifications
You must be signed in to change notification settings - Fork 20
Open
Description
fun attachTexture(texture: Texture) {
attachedTexture?.decreaseRef()
attachedTexture = texture
if (frameBuffer == GL_NONE) {
frameBuffer = GLUtil.createFrameBuffer()
}
**bind()**
Util.assert(texture.width > 0 && texture.height > 0 && (texture.type == GL_TEXTURE_2D || texture.type == GLES11Ext.GL_TEXTURE_EXTERNAL_OES) && glIsTexture(texture.texture) && frameBuffer > 0, "texture error")
glCheck { glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, texture.type, texture.texture, 0) }
}
override fun bindOutput() {
output?.let { outputTexture ->
FrameBufferPool.obtainFrameBuffer().apply {
attachTexture(outputTexture)
**bind()**
Util.assert(outputTexture.width > 0 && outputTexture.height > 0, "output size error")
glCheck { glViewport(0, 0, outputTexture.width, outputTexture.height) }
}
}
}
Metadata
Metadata
Assignees
Labels
No labels