MCPcopy Index your code
hub / github.com/g3n/engine / UseProgram

Method UseProgram

gls/gls-desktop.go:739–752  ·  view source on GitHub ↗

UseProgram sets the specified program as the current program.

(prog *Program)

Source from the content-addressed store, hash-verified

737
738// UseProgram sets the specified program as the current program.
739func (gs *GLS) UseProgram(prog *Program) {
740
741 if prog.handle == 0 {
742 panic("Invalid program")
743 }
744 C.glUseProgram(C.GLuint(prog.handle))
745 gs.prog = prog
746
747 // Inserts program in cache if not already there.
748 if !gs.programs[prog] {
749 gs.programs[prog] = true
750 log.Debug("New Program activated. Total: %d", len(gs.programs))
751 }
752}
753
754// Ptr takes a slice or pointer (to a singular scalar value or the first
755// element of an array or slice) and returns its GL-compatible address.

Callers 1

SetProgramMethod · 0.45

Calls 1

DebugMethod · 0.80

Tested by

no test coverage detected