OpenTkEngine.Core.ModelMesh.GetVaoID C# (CSharp) Method

GetVaoID() public method

public GetVaoID ( ) : int
return int
        public int GetVaoID()
        {
            return _vaoID;
        }

Usage Example

Beispiel #1
0
        public static void RenderModelMesh(ModelMesh mesh, Matrix4 matrix, int offset, int count, Color4 color)
        {
            SetColor(color);
            Texture.BindNone();
            Lighting.EnableLighting();
            if (_currentVao != mesh.GetVaoID())
            {
                mesh.BindVAO();
                _currentVao = mesh.GetVaoID();
            }
            int uModelLocation = _currentShader.GetUniformLocation("uModel");
            GL.UniformMatrix4(uModelLocation, true, ref matrix);

            if (_worldMatrixChanged)
            {
                int uWorldLocation = _currentShader.GetUniformLocation("uWorld");
                Matrix4 worldMatrix = _worldMatrixStack.Count > 0 ? (Matrix4)_worldMatrixStack.Peek() : _worldMatrix;
                GL.UniformMatrix4(uWorldLocation, true, ref worldMatrix);
                Lighting.ApplyLightMatrix(worldMatrix);
            }

            GL.DrawElements(PrimitiveType.Triangles, count, DrawElementsType.UnsignedInt, offset * sizeof(uint));
            Lighting.DisableLighting();
        }