예제 #1
0
        public void Constructor_CorrectlyInitialises_Instance()
        {
            var attribute = new ShaderAttribute("position", 0, 8, ActiveAttribType.FloatVec2);

            attribute.ShouldSatisfyAllConditions(
                () => attribute.Name.ShouldBe("position"),
                () => attribute.Location.ShouldBe(0),
                () => attribute.Size.ShouldBe(8),
                () => attribute.AttribType.ShouldBe(ActiveAttribType.FloatVec2)
            );
        }
예제 #2
0
        private void GivenProgramHasAttribute(string name, int expectedLocation = 2)
        {
            var attribute = new ShaderAttribute(name, expectedLocation, 8, ActiveAttribType.FloatVec2);
            adapter.Setup(a => a.GetAttribLocation(program.Handle, name))
                   .Returns(expectedLocation);
            adapter.Setup(a => a.GetActiveAttrib(program.Handle, expectedLocation, It.IsAny<int>()))
                   .Returns(attribute);

            program.Link();
            program.GetAttributeLocation(name);
        }