Skip to content

基于自定义规则的番剧采集APP,支持流媒体在线观看,支持弹幕,支持实时超分辨率。

enable dGPU for windows

Predidit491225b89ee0
diff --git a/windows/runner/CMakeLists.txt b/windows/runner/CMakeLists.txt
index 6e81fe50..033078a4 100644
--- a/windows/runner/CMakeLists.txt
+++ b/windows/runner/CMakeLists.txt
@@ -40,3 +40,11 @@ target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}")
# Run the Flutter tool portions of the build. This must not be removed.
add_dependencies(${BINARY_NAME} flutter_assemble)
+
+# Remove the .exp and .lib files generated by the linker.
+# These files are not needed for the application and can be safely removed.
+add_custom_command(TARGET ${BINARY_NAME}
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND} -E remove "${CMAKE_INSTALL_PREFIX}/${BINARY_NAME}.exp"
+ COMMAND ${CMAKE_COMMAND} -E remove "${CMAKE_INSTALL_PREFIX}/${BINARY_NAME}.lib"
+)
diff --git a/windows/runner/main.cpp b/windows/runner/main.cpp
index 091640a9..d82407ca 100644
--- a/windows/runner/main.cpp
+++ b/windows/runner/main.cpp
@@ -5,6 +5,17 @@
#include "flutter_window.h"
#include "utils.h"
+// recommended by NVIDIA to enable high-performance GPU
+extern "C" {
+ __declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001;
+}
+
+// recommended by AMD to enable high-performance GPU
+extern "C" {
+ __declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1;
+}
+
+
int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev,
_In_ wchar_t *command_line, _In_ int show_command) {
// Attach to console when present (e.g., 'flutter run') or create a