MCPcopy
hub / github.com/EngoEngine/engo / initShaders

Function initShaders

common/render_shaders.go:113–130  ·  view source on GitHub ↗
(w *ecs.World)

Source from the content-addressed store, hash-verified

111var shaderInitMutex sync.Mutex
112
113func initShaders(w *ecs.World) error {
114 shaderInitMutex.Lock()
115 defer shaderInitMutex.Unlock()
116
117 if !shadersSet {
118 var err error
119
120 for _, shader := range shaders {
121 err = shader.Setup(w)
122 if err != nil {
123 return err
124 }
125 }
126
127 shadersSet = true
128 }
129 return nil
130}
131
132// LoadShader takes a Vertex-shader and Fragment-shader, compiles them and attaches them to a newly created glProgram.
133// It will log possible compilation errors

Callers 2

NewMethod · 0.85

Calls 1

SetupMethod · 0.65

Tested by 1