MCPcopy Create free account
hub / github.com/g3n/engine / RenderSetup

Method RenderSetup

gui/chart.go:704–718  ·  view source on GitHub ↗

RenderSetup is called by the renderer before drawing this graphic It overrides the original panel RenderSetup Calculates the model matrix and transfer to OpenGL.

(gs *gls.GLS, rinfo *core.RenderInfo)

Source from the content-addressed store, hash-verified

702// It overrides the original panel RenderSetup
703// Calculates the model matrix and transfer to OpenGL.
704func (lg *Graph) RenderSetup(gs *gls.GLS, rinfo *core.RenderInfo) {
705
706 // Sets model matrix
707 var mm math32.Matrix4
708 lg.SetModelMatrix(gs, &mm)
709
710 // Transfer model matrix uniform
711 location := lg.uniMatrix.Location(gs)
712 gs.UniformMatrix4fv(location, 1, false, &mm[0])
713
714 // Sets bounds in OpenGL window coordinates and transfer to shader
715 _, _, _, height := gs.GetViewport()
716 location = lg.uniBounds.Location(gs)
717 gs.Uniform4f(location, lg.pospix.X, float32(height)-lg.pospix.Y, lg.width, lg.height)
718}
719
720//
721// Chart material

Callers

nothing calls this directly

Calls 5

SetModelMatrixMethod · 0.80
LocationMethod · 0.80
UniformMatrix4fvMethod · 0.45
GetViewportMethod · 0.45
Uniform4fMethod · 0.45

Tested by

no test coverage detected