示例#1
0
func NewShader(isvert bool) *Shader {
	type_ := gl.GLenum(gl.FRAGMENT_SHADER)
	if isvert {
		type_ = gl.GLenum(gl.VERTEX_SHADER)
	}
	id := gl.CreateShader(type_)
	sh := &Shader{id, isvert}
	return sh
}
示例#2
0
func (p *Program) UniformTexture_(name string, t ITexture, activeTexture int) {
	gl.ActiveTexture(gl.GLenum(activeTexture))
	t.Id().Bind(gl.TEXTURE_2D)
	p.UniformInt(name, activeTexture-int(gl.TEXTURE0))
}