Exemple #1
0
        public void CreateDestinationTexture_ShouldReturnGlTexture_When_GpuBufferFormatIsValid()
        {
            var glCalculatorHelper = new GlCalculatorHelper();

            glCalculatorHelper.InitializeForTest(GpuResources.Create().ConsumeValueOrDie());

            var status = glCalculatorHelper.RunInGlContext(() => {
                var glTexture = glCalculatorHelper.CreateDestinationTexture(32, 24, GpuBufferFormat.kBGRA32);

                Assert.AreEqual(glTexture.width, 32);
                Assert.AreEqual(glTexture.height, 24);
                return(Status.Ok());
            });

            Assert.True(status.ok);
        }
        public void CreateDestinationTexture_ShouldReturnGlTexture_When_GpuBufferFormatIsValid()
        {
            using (var glCalculatorHelper = new GlCalculatorHelper())
            {
                glCalculatorHelper.InitializeForTest(GpuResources.Create().Value());

                var status = glCalculatorHelper.RunInGlContext(() =>
                {
                    var glTexture = glCalculatorHelper.CreateDestinationTexture(32, 24, GpuBufferFormat.kBGRA32);

                    Assert.AreEqual(32, glTexture.width);
                    Assert.AreEqual(24, glTexture.height);
                });

                Assert.True(status.Ok());
            }
        }