From c4853792a59c13fc379c9b50ccc9dcda9fb09137 Mon Sep 17 00:00:00 2001 From: bloeys Date: Mon, 11 Jul 2022 11:36:26 +0400 Subject: [PATCH] Use cached getUniform in imgui --- ui/imgui/imgui.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ui/imgui/imgui.go b/ui/imgui/imgui.go index 371ee93..a2d9e23 100755 --- a/ui/imgui/imgui.go +++ b/ui/imgui/imgui.go @@ -66,8 +66,7 @@ func (i *ImguiInfo) Render(winWidth, winHeight float32, fbWidth, fbHeight int32) // DisplayMin is typically (0,0) for single viewport apps. i.Mat.Bind() - - gl.Uniform1i(gl.GetUniformLocation(i.Mat.ShaderProg.ID, gl.Str("Texture\x00")), 0) + i.Mat.SetUnifInt32("Texture", 0) //PERF: only update the ortho matrix on window resize orthoMat := gglm.Ortho(0, float32(winWidth), 0, float32(winHeight), 0, 20)