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

Method RenderSetup

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

504// It overrides the original panel RenderSetup
505// Calculates the model matrix and transfer to OpenGL.
506func (sx *chartScaleX) RenderSetup(gs *gls.GLS, rinfo *core.RenderInfo) {
507
508 // Sets model matrix
509 var mm math32.Matrix4
510 sx.SetModelMatrix(gs, &mm)
511
512 // Transfer model matrix uniform
513 location := sx.uniMatrix.Location(gs)
514 gs.UniformMatrix4fv(location, 1, false, &mm[0])
515
516 // Sets bounds in OpenGL window coordinates and transfer to shader
517 _, _, _, height := gs.GetViewport()
518 location = sx.uniBounds.Location(gs)
519 gs.Uniform4f(location, sx.pospix.X, float32(height)-sx.pospix.Y, sx.width, sx.height)
520}
521
522//
523// ChartScaleY is a panel with LINE geometry which draws the chart Y vertical scale axis,

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