Exemplo n.º 1
0
        public void BufferSubData_Expression_UsesCorrectOffsetAndSize()
        {
            // Arrange
            var gl = Substitute.For<IOpenGL30>();
            gl.WhenForAnyArgs(g => g.GenBuffers(Arg.Any<int>(), Arg.Any<uint[]>()))
                .Do(x =>
                { ((uint[])x[1])[0] = 1; });

            var buffer = new VertexBuffer<PositionNormalTexCoord>(0, gl);

            // Act
            buffer.BufferSubData(BufferUsage.StaticDraw, x => x.TexCoord);

            // Assert
            gl.Received().BufferSubData((uint)BufferTarget.Array, new IntPtr(24), new IntPtr(8), Arg.Any<IntPtr>());

        }