mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-12 22:17:26 +01:00
Bug fix: blending
This commit is contained in:
parent
62e8755b64
commit
8004bd802e
@ -76,7 +76,7 @@ func (context *Context) Screen() graphics.Texture {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (context *Context) Clear() {
|
func (context *Context) Clear() {
|
||||||
C.glClearColor(0, 0, 0, 0)
|
C.glClearColor(0, 0, 0, 255)
|
||||||
C.glClear(C.GL_COLOR_BUFFER_BIT)
|
C.glClear(C.GL_COLOR_BUFFER_BIT)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -227,8 +227,10 @@ func (context *Context) setOffscreen(texture *Texture) {
|
|||||||
if err := C.glCheckFramebufferStatus(C.GL_FRAMEBUFFER); err != C.GL_FRAMEBUFFER_COMPLETE {
|
if err := C.glCheckFramebufferStatus(C.GL_FRAMEBUFFER); err != C.GL_FRAMEBUFFER_COMPLETE {
|
||||||
panic(fmt.Sprintf("glBindFramebuffer failed: %d", err))
|
panic(fmt.Sprintf("glBindFramebuffer failed: %d", err))
|
||||||
}
|
}
|
||||||
|
|
||||||
C.glEnable(C.GL_BLEND)
|
C.glEnable(C.GL_BLEND)
|
||||||
C.glBlendFunc(C.GL_SRC_ALPHA, C.GL_ONE_MINUS_SRC_ALPHA)
|
C.glBlendFuncSeparate(C.GL_SRC_ALPHA, C.GL_ONE_MINUS_SRC_ALPHA,
|
||||||
|
C.GL_ZERO, C.GL_ONE)
|
||||||
|
|
||||||
C.glViewport(0, 0, C.GLsizei(abs(texture.textureWidth)),
|
C.glViewport(0, 0, C.GLsizei(abs(texture.textureWidth)),
|
||||||
C.GLsizei(abs(texture.textureHeight)))
|
C.GLsizei(abs(texture.textureHeight)))
|
||||||
|
Loading…
Reference in New Issue
Block a user