UseProgram sets the specified program as the current program.
(prog *Program)
| 737 | |
| 738 | // UseProgram sets the specified program as the current program. |
| 739 | func (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. |