RenderSetup is called by the Engine before drawing the object
(gl *gls.GLS, rinfo *core.RenderInfo)
| 842 | |
| 843 | // RenderSetup is called by the Engine before drawing the object |
| 844 | func (p *Panel) RenderSetup(gl *gls.GLS, rinfo *core.RenderInfo) { |
| 845 | |
| 846 | // Sets texture valid flag in uniforms |
| 847 | // depending if the material has texture |
| 848 | if p.mat.TextureCount() > 0 { |
| 849 | p.udata.textureValid = 1 |
| 850 | } else { |
| 851 | p.udata.textureValid = 0 |
| 852 | } |
| 853 | |
| 854 | // Sets model matrix |
| 855 | var mm math32.Matrix4 |
| 856 | p.SetModelMatrix(gl, &mm) |
| 857 | |
| 858 | // Transfer model matrix uniform |
| 859 | location := p.uniMatrix.Location(gl) |
| 860 | gl.UniformMatrix4fv(location, 1, false, &mm[0]) |
| 861 | |
| 862 | // Transfer panel parameters combined uniform |
| 863 | location = p.uniPanel.Location(gl) |
| 864 | const vec4count = 8 |
| 865 | gl.Uniform4fv(location, vec4count, &p.udata.bounds.X) |
| 866 | } |
| 867 | |
| 868 | // SetModelMatrix calculates and sets the specified matrix with the model matrix for this panel |
| 869 | func (p *Panel) SetModelMatrix(gl *gls.GLS, mm *math32.Matrix4) { |
nothing calls this directly
no test coverage detected