From 8cf5cefe6e91a5a1ed6eeaae4d94760d84c304a6 Mon Sep 17 00:00:00 2001 From: Minteck Date: Sat, 5 Jun 2021 19:27:48 +0200 Subject: Presque sortie du jeu --- views/script/menu_gpuinfo.js | 69 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 views/script/menu_gpuinfo.js (limited to 'views/script/menu_gpuinfo.js') diff --git a/views/script/menu_gpuinfo.js b/views/script/menu_gpuinfo.js new file mode 100644 index 0000000..4177cfc --- /dev/null +++ b/views/script/menu_gpuinfo.js @@ -0,0 +1,69 @@ +if (require('os').platform !== "darwin") { + gpuinfo = require('@electron/remote').app.getGPUFeatureStatus(); + document.write("kartik
"); + document.write("├ kartik.accel
"); + if (gpuinfo['2d_canvas'].startsWith("enabled")) { + document.write("│ ├ kartik.accel.Canvas
"); + } else { + document.write("│ ├ kartik.accel.Canvas
"); + } + if (gpuinfo['gpu_compositing'].startsWith("enabled")) { + document.write("│ ├ kartik.accel.Compositing
"); + } else { + document.write("│ ├ kartik.accel.Compositing
"); + } + if (gpuinfo['video_decode'].startsWith("enabled")) { + document.write("│ └ kartik.accel.VideoDecode
"); + } else { + document.write("│ └ kartik.accel.VideoDecode
"); + } + document.write("├ kartik.raster
"); + if (gpuinfo['multiple_raster_threads'].startsWith("enabled")) { + document.write("│ ├ kartik.raster.Threaded
"); + } else { + document.write("│ ├ kartik.raster.Threaded
"); + } + if (gpuinfo['oop_rasterization'].startsWith("enabled")) { + document.write("│ ├ kartik.raster.ObjectOP
"); + } else { + document.write("│ ├ kartik.raster.ObjectOP
"); + } + if (gpuinfo['rasterization'].startsWith("enabled")) { + document.write("│ └ kartik.raster.Common
"); + } else { + document.write("│ └ kartik.raster.Common
"); + } + document.write("└ kartik.renderer
"); + if (gpuinfo['opengl'].startsWith("enabled")) { + document.write("  ├ kartik.renderer.OpenGL
"); + } else { + document.write("  ├ kartik.renderer.OpenGL
"); + } + if (gpuinfo['skia_renderer'].startsWith("enabled")) { + document.write("  ├ kartik.renderer.Skia
"); + } else { + document.write("  ├ kartik.renderer.Skia
"); + } + if (gpuinfo['vulkan'].startsWith("enabled")) { + document.write("  └ kartik.renderer.Vulkan
"); + } else { + document.write("  └ kartik.renderer.Vulkan
"); + } +} else { + document.write("You are using macOS

Kartik can't detect GPU info
for Apple macOS."); +} + +document.onkeydown = (e) => { + if (e.shiftKey) { + document.getElementById('gpuinfo-inner').style.opacity = "1"; + document.getElementById('gpuinfo-outer').style.display = "none"; + } else { + document.getElementById('gpuinfo-inner').style.opacity = "0"; + document.getElementById('gpuinfo-outer').style.display = ""; + } +} + +document.onkeyup = (e) => { + document.getElementById('gpuinfo-inner').style.opacity = "0"; + document.getElementById('gpuinfo-outer').style.display = ""; +} \ No newline at end of file -- cgit