From da7c66419a9df8a2282e1c66be5fb05e90ef91ea Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Wed, 10 Apr 2019 22:04:36 +1000 Subject: [PATCH] [c-host] a few build tweaks and updated README.md --- VERSION | 2 +- c-host/CMakeLists.txt | 11 +++++---- c-host/README.md | 32 ++++++++++++++++++++++++++ c-host/platform/Windows/src/platform.c | 2 -- 4 files changed, 40 insertions(+), 7 deletions(-) diff --git a/VERSION b/VERSION index 903033b4..7eca28ce 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -a12-146-ga03075416c+1 \ No newline at end of file +a12-147-gd5ad53dae7+1 \ No newline at end of file diff --git a/c-host/CMakeLists.txt b/c-host/CMakeLists.txt index c47b7807..8acce248 100644 --- a/c-host/CMakeLists.txt +++ b/c-host/CMakeLists.txt @@ -23,8 +23,7 @@ add_compile_options( "-ffunction-sections" "$<$:-O0;-g3;-ggdb>" ) -set(CMAKE_EXE_LINKER FLAGS "-Wl,--gc-sections") -set(CMAKE_C_STANDARD 11) +set(CMAKE_C_STANDARD 11) execute_process( COMMAND cat ../VERSION @@ -53,11 +52,15 @@ set(SOURCES add_subdirectory(platform) -add_executable(looking-glass-host ${SOURCES}) +if(WIN32) + add_executable(looking-glass-host WIN32 ${SOURCES}) +else() + add_executable(looking-glass-host ${SOURCES}) +endif() target_link_libraries(looking-glass-host platform ) - +set_target_properties(looking-glass-host PROPERTIES LINK_FLAGS "-Wl,--gc-sections") install(PROGRAMS ${CMAKE_BINARY_DIR}/looking-glass-host DESTINATION bin/ COMPONENT binary) feature_summary(WHAT ENABLED_FEATURES DISABLED_FEATURES) diff --git a/c-host/README.md b/c-host/README.md index 52175bc2..739d0b62 100644 --- a/c-host/README.md +++ b/c-host/README.md @@ -41,4 +41,36 @@ cmake -G "MSYS Makefiles" .. make ``` +# Where is the log? + +It is in your user's temp directory: + + %TEMP%\looking-glass-host.txt + +For example: + + C:\Users\YourUser\AppData\Local\Temp\looking-glass-host.txt + +# Why does this version require Administrator privileges + +This is intentional for several reasons. + +1. NvFBC requires a system wide hook to correctly obtain the cursor position as NVIDIA decided to not provide this as part of the cursor updates. +2. NvFBC requires administrator level access to enable the interface in the first place. (WIP) +3. DXGI performance can be improved if we have this. (WIP) + +# Why isn't there a build with NvFBC support available. + +Because NVIDIA have decided to put restrictions on the NvFBC API that simply make it incompatible with the GPL/2 licence. Providing a pre-built binary with NvFBC support would violate the EULA I have agreed to in order to access the NVidia Capture SDK. + +# Why can't I compile NvFBC support into the host + +You must download and install the NVidia Capture SDK. Please note that by doing so you will be agreeing to NVIDIA's SDK License agreement and the binary you produce can not be distributed. + +# Can't you just re-write the NvFBC headers? + +Technically yes, but since I have already agreed to the SDK License Agreement and seen the headers, I am tainted. + +Until someone is able to reverse engineer these headers without prior knowleadge obtained from the SDK, and without agreeing to the NVIDIA SDK License, we can not legally include the headers or release a binary with NvFBC support built in. + _-Geoff_ diff --git a/c-host/platform/Windows/src/platform.c b/c-host/platform/Windows/src/platform.c index bdaa736b..ab6a8425 100644 --- a/c-host/platform/Windows/src/platform.c +++ b/c-host/platform/Windows/src/platform.c @@ -99,7 +99,6 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine PSP_DEVICE_INTERFACE_DETAIL_DATA infData = NULL; SP_DEVICE_INTERFACE_DATA deviceInterfaceData; -#if 0 // redirect stderr to a file { char tempPath[MAX_PATH+1]; @@ -110,7 +109,6 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine freopen(path, "a", stderr); free(path); } -#endif // always flush stderr setbuf(stderr, NULL);