Example #1
0
        public void CreateDefaultContextWithOptionsIsValid()
        {
            using var ctx = CreateGlContext();
            ctx.MakeCurrent();

            var options   = new GRContextOptions();
            var grContext = GRContext.CreateGl(options);

            Assert.NotNull(grContext);
        }
Example #2
0
        public void CreateSpecificContextWithOptionsIsValid()
        {
            using var ctx = CreateGlContext();
            ctx.MakeCurrent();

            var glInterface = GRGlInterface.Create();

            Assert.True(glInterface.Validate());

            var options   = new GRContextOptions();
            var grContext = GRContext.CreateGl(glInterface, options);

            Assert.NotNull(grContext);
        }
        public void CreateVkContextWithOptionsIsValid()
        {
            using var ctx = CreateVkContext();

            using var grVkBackendContext = new GRVkBackendContext
                  {
                      VkInstance          = (IntPtr)ctx.Instance.RawHandle.ToUInt64(),
                      VkPhysicalDevice    = (IntPtr)ctx.PhysicalDevice.RawHandle.ToUInt64(),
                      VkDevice            = (IntPtr)ctx.Device.RawHandle.ToUInt64(),
                      VkQueue             = (IntPtr)ctx.GraphicsQueue.RawHandle.ToUInt64(),
                      GraphicsQueueIndex  = ctx.GraphicsFamily,
                      GetProcedureAddress = ctx.GetProc
                  };

            Assert.NotNull(grVkBackendContext);

            var options = new GRContextOptions();

            using var grContext = GRContext.CreateVulkan(grVkBackendContext, options);

            Assert.NotNull(grContext);
        }