Пример #1
0
        public static void TestGenericVectorWrite()
        {
            GenericVector <float> vector1 = new GenericVector <float>(3)
            {
                1, 4, 7
            };
            GenericVector <float> vector2 = new GenericVector <float>(3)
            {
                4, 6, 12
            };

            vector1.Write(vector2);
            Assert.AreEqual(vector1.R, 4);
            Assert.AreEqual(vector1.G, 6);
            Assert.AreEqual(vector1.B, 12);
        }
Пример #2
0
        public static void TestDrawColor()
        {
            RenderBuffer <float>     buffer     = new RenderBuffer <float>(CRenderSettings.RenderWidth, CRenderSettings.RenderHeight, channelCount: 3);
            CharRenderBuffer <float> charBuffer = new CharRenderBuffer <float>(buffer);

            GenericVector <float> color = new GenericVector <float>(3)
            {
                0, 0, 0
            };

            for (int i = 0; i < buffer.Width; i++)
            {
                for (int j = 0; j < buffer.Height; j++)
                {
                    buffer.WritePixel(i, j, color);
                }
                color.Write((float)i / buffer.Width);
            }
            CRenderer.Render(charBuffer);
        }