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

Method RenderSetup

gui/chart.go:591–605  ·  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

589// It overrides the original panel RenderSetup
590// Calculates the model matrix and transfer to OpenGL.
591func (sy *chartScaleY) RenderSetup(gs *gls.GLS, rinfo *core.RenderInfo) {
592
593 // Sets model matrix
594 var mm math32.Matrix4
595 sy.SetModelMatrix(gs, &mm)
596
597 // Transfer model matrix uniform
598 location := sy.uniMatrix.Location(gs)
599 gs.UniformMatrix4fv(location, 1, false, &mm[0])
600
601 // Sets bounds in OpenGL window coordinates and transfer to shader
602 _, _, _, height := gs.GetViewport()
603 location = sy.uniBounds.Location(gs)
604 gs.Uniform4f(location, sy.pospix.X, float32(height)-sy.pospix.Y, sy.width, sy.height)
605}
606
607//
608// Graph is the GUI element that represents a single plotted function.

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