Control over srgba textures and srgba framebuffer

This commit is contained in:
bloeys
2023-10-07 10:58:01 +04:00
parent 9f9744a142
commit da50d597f9
5 changed files with 33 additions and 6 deletions

View File

@ -198,12 +198,22 @@ func initOpenGL() error {
gl.FrontFace(gl.CCW)
gl.Enable(gl.BLEND)
gl.Enable(gl.FRAMEBUFFER_SRGB)
gl.BlendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA)
gl.ClearColor(0, 0, 0, 1)
return nil
}
func SetSrgbFramebuffer(isEnabled bool) {
if isEnabled {
gl.Enable(gl.FRAMEBUFFER_SRGB)
} else {
gl.Disable(gl.FRAMEBUFFER_SRGB)
}
}
func SetVSync(enabled bool) {
assert.T(isInited, "engine.Init was not called!")