コード例 #1
0
ファイル: main.cs プロジェクト: jpbruyere/vke.net
 //in the thread of the keyboard
 void loadTexture(string path)
 {
     try {
         if (path.EndsWith("ktx", StringComparison.OrdinalIgnoreCase))
         {
             nextTexture = KTX.KTX.Load(presentQueue, cmdPool, path,
                                        VkImageUsageFlags.Sampled, VkMemoryPropertyFlags.DeviceLocal, true);
         }
         else
         {
             nextTexture = Image.Load(dev, path);
         }
         updateViewRequested = true;
     } catch (Exception ex) {
         Console.WriteLine(ex);
         nextTexture = null;
     }
 }
コード例 #2
0
 //in the thread of the keyboard
 void loadTexture(string path)
 {
     try {
         Console.WriteLine($"Loading:{path}");
         if (path.EndsWith("ktx", StringComparison.OrdinalIgnoreCase))
         {
             nextTexture = KTX.KTX.Load(presentQueue, cmdPool, path,
                                        VkImageUsageFlags.Sampled, imgProp, genMipMaps, tiling);
         }
         else
         {
             nextTexture = Image.Load(dev, presentQueue, cmdPool, path, VkFormat.R8g8b8a8Unorm, imgProp, tiling, genMipMaps);
         }
         updateViewRequested = true;
     } catch (Exception ex) {
         Console.WriteLine(ex);
         nextTexture = null;
     }
 }