mirror of
https://github.com/bloeys/nmage.git
synced 2025-12-29 13:28:20 +00:00
Day7: ImGUI interaction+OpenGL 4.1+Bugs+ambient color control
This commit is contained in:
@ -4,7 +4,7 @@ import (
|
||||
"github.com/bloeys/gglm/gglm"
|
||||
"github.com/bloeys/go-sdl-engine/buffers"
|
||||
"github.com/bloeys/go-sdl-engine/logging"
|
||||
"github.com/go-gl/gl/v4.6-core/gl"
|
||||
"github.com/go-gl/gl/v4.1-core/gl"
|
||||
)
|
||||
|
||||
type ShaderProgram struct {
|
||||
@ -70,6 +70,11 @@ func (sp *ShaderProgram) DisableAttribute(attribName string) {
|
||||
gl.DisableVertexAttribArray(uint32(sp.GetAttribLoc(attribName)))
|
||||
}
|
||||
|
||||
func (sp *ShaderProgram) SetUnifFloat32(uniformName string, val float32) {
|
||||
loc := gl.GetUniformLocation(sp.ID, gl.Str(uniformName+"\x00"))
|
||||
gl.ProgramUniform1f(sp.ID, loc, val)
|
||||
}
|
||||
|
||||
func (sp *ShaderProgram) SetUnifVec2(uniformName string, vec2 *gglm.Vec2) {
|
||||
loc := gl.GetUniformLocation(sp.ID, gl.Str(uniformName+"\x00"))
|
||||
gl.ProgramUniform2fv(sp.ID, loc, 1, &vec2.Data[0])
|
||||
|
||||
Reference in New Issue
Block a user