FireflyGL.ShaderProgram.AddAttribLocation C# (CSharp) Method

AddAttribLocation() public method

public AddAttribLocation ( string Attribute ) : void
Attribute string
return void
        public void AddAttribLocation(string Attribute)
        {
            if (!locations.ContainsKey(Attribute))
            {
                locations.Add(Attribute, new Attribute(Attribute, GL.GetAttribLocation(id, Attribute)));
                Utility.ProcessOGLErrors();
            }
        }

Usage Example

Beispiel #1
0
        public Mesh(MeshData data)
        {
            Camera3D.CameraChanged += UpdateShaderMatrix;
            children = new LinkedList<Mesh>();

            Data = data;

            vertexShader = new VertexShader();
            vertexShader.LoadFromSource(vertexShaderSource);
            fragmentShader = new FragmentShader();
            fragmentShader.LoadFromSource(fragmentShaderSource);

            shaderProgram = new ShaderProgram(vertexShader, fragmentShader);
            shaderProgram.Link();
            shaderProgram.Use();

            shaderProgram.AddAttribLocation("position");
            shaderProgram.AddAttribLocation("color");
            shaderProgram.AddAttribLocation("normal");
            shaderProgram.AddUniformLocation("matrix");
            shaderProgram.AddUniformLocation("rotation");

            rotation = Matrix4.Identity;
            scale = Matrix4.Identity;
            translation = Matrix4.Identity;
            projection = Matrix4.CreatePerspectiveFieldOfView((float)Math.PI / 2.5F, 1, 0.1F, 100F);
            shaderModelMatrix = Matrix4.Identity;
            shaderRotationMatrix = Matrix4.Identity;

            window = Matrix4.Scale(Firefly.Window.Height / (float)Firefly.Window.Width, 1, 1);

            UpdateShaderMatrix();
        }
All Usage Examples Of FireflyGL.ShaderProgram::AddAttribLocation