### Installation
Source: https://github.com/jlai/python-spoutgl/blob/main/README.md
Command to install the SpoutGL library using pip.
```bash
pip install SpoutGL
```
--------------------------------
### Startup and Linkify Functions
Source: https://github.com/jlai/python-spoutgl/blob/main/vendor/SpoutGL/VS2022/UpgradeLog.htm
JavaScript code for handling document load events, toggling table row visibility, scrolling to the first visible row, and linkifying text content within an element.
```javascript
var startupFunction = function() {
linkifyElement("messages");
};
if(window.attachEvent) {
window.attachEvent('onload', startupFunction);
} else if (window.addEventListener) {
window.addEventListener('load', startupFunction, false);
} else {
document.addEventListener('load', startupFunction, false);
}
// Toggles the visibility of table rows with the specified name
function toggleTableRowsByName(name) {
var allRows = document.getElementsByTagName('tr');
for (i=0; i < allRows.length; i++) {
var currentName = allRows[i].getAttribute('name');
if(!!currentName && currentName.indexOf(name) == 0) {
var isVisible = allRows[i].style.display == '';
isVisible ? allRows[i].style.display = 'none' : allRows[i].style.display = '';
}
}
}
function scrollToFirstVisibleRow(name) {
var allRows = document.getElementsByTagName('tr');
for (i=0; i < allRows.length; i++) {
var currentName = allRows[i].getAttribute('name');
var isVisible = allRows[i].style.display == '';
if(!!currentName && currentName.indexOf(name) == 0 && isVisible) {
allRows[i].scrollIntoView(true);
return true;
}
}
return false;
}
// Linkifies the specified text content, replaces candidate links with html links
function linkify(text) {
if(!text || 0 === text.length) {
return text;
}
// Find http, https and ftp links and replace them with hyper links
var urlLink = /(http|https|ftp)\:\/\/\[a-zA-Z0-9\-\. \]+(: \[a-zA-Z0-9\]\*)?\/?(\[a-zA-Z0-9\-\.\_\?\,\/\\\+&%\$#\=~;\{\}\])*/gi;
return text.replace(urlLink, '$&') ;
}
// Linkifies the specified element by ID
function linkifyElement(id) {
var element = document.getElementById(id);
if(!!element) {
element.innerHTML = linkify(element.innerHTML);
}
}
function ToggleMessageVisibility(projectName) {
if(!projectName || 0 === projectName.length) {
return;
}
toggleTableRowsByName("MessageRowClass" + projectName);
toggleTableRowsByName('MessageRowHeaderShow' + projectName);
toggleTableRowsByName('MessageRowHeaderHide' + projectName);
}
function ScrollToFirstVisibleMessage(projectName) {
if(!projectName || 0 === projectName.length) {
return;
}
// First try the 'Show messages' row
if(!scrollToFirstVisibleRow('MessageRowHeaderShow' + projectName)) {
// Failed to find a visible row for 'Show messages', try an actual message row
scrollToFirstVisibleRow('MessageRowClass' + projectName);
}
}
```
--------------------------------
### Copy Binaries to Build Directory
Source: https://github.com/jlai/python-spoutgl/blob/main/vendor/SpoutGL/CMakeLists.txt
Custom commands to copy the built Spout libraries to the Binaries folder after the build.
```cmake
# Copy binaries to the BUILD/Binaries folder
# Spout
add_custom_command(TARGET Spout POST_BUILD
COMMAND ${CMAKE_COMMAND} -E
copy $ ${CMAKE_BINARY_DIR}/Binaries/${OUTPUT_ARCH_DEST}/${OUTPUT_SHARED_LIB}
)
add_custom_command(TARGET Spout POST_BUILD
COMMAND ${CMAKE_COMMAND} -E
copy ${CMAKE_CURRENT_BINARY_DIR}/${ConfigOutputDirectory}${OUTPUT_IMPORT_LIB} ${CMAKE_BINARY_DIR}/Binaries/${OUTPUT_ARCH_DEST}/${OUTPUT_IMPORT_LIB}
)
# Spout_static
add_custom_command(TARGET Spout_static POST_BUILD
COMMAND ${CMAKE_COMMAND} -E
copy $ ${CMAKE_BINARY_DIR}/Binaries/${OUTPUT_ARCH_DEST}/${OUTPUT_STATIC_LIB}
)
```
--------------------------------
### Static Spout Library Build
Source: https://github.com/jlai/python-spoutgl/blob/main/vendor/SpoutGL/CMakeLists.txt
Builds a static version of the Spout library.
```cmake
add_library(Spout_static STATIC ${SpoutSources} )
target_link_libraries(Spout_static PRIVATE ${SpoutLink} )
target_compile_definitions(Spout_static PRIVATE SPOUT_BUILD_DLL)
```
--------------------------------
### Output Library Filenames
Source: https://github.com/jlai/python-spoutgl/blob/main/vendor/SpoutGL/CMakeLists.txt
Defines the output filenames for static, shared, and import libraries, considering MINGW.
```cmake
if(MINGW)
set(OUTPUT_STATIC_LIB "libSpout_static.a")
set(OUTPUT_SHARED_LIB "libSpout.dll")
set(OUTPUT_IMPORT_LIB "libSpout.dll.a")
else()
set(OUTPUT_STATIC_LIB "Spout_static.lib")
set(OUTPUT_SHARED_LIB "Spout.dll")
set(OUTPUT_IMPORT_LIB "Spout.lib")
endif()
```
--------------------------------
### Compiler Options for Non-MSVC
Source: https://github.com/jlai/python-spoutgl/blob/main/vendor/SpoutGL/CMakeLists.txt
Applies SSE4 compiler options for non-MSVC compilers.
```cmake
if(NOT MSVC)
target_compile_options(Spout_static PRIVATE -msse4)
target_compile_options(Spout PRIVATE -msse4)
endif()
```
--------------------------------
### Spout Sources
Source: https://github.com/jlai/python-spoutgl/blob/main/vendor/SpoutGL/CMakeLists.txt
Defines the source files for the Spout library.
```cmake
set(SpoutSources
Spout.h
SpoutCommon.h
SpoutCopy.h
SpoutDirectX.h
SpoutFrameCount.h
SpoutGL.h
SpoutGLextensions.h
SpoutReceiver.h
SpoutSender.h
SpoutSenderNames.h
SpoutSharedMemory.h
SpoutUtils.h
Spout.cpp
SpoutCopy.cpp
SpoutDirectX.cpp
SpoutFrameCount.cpp
SpoutGL.cpp
SpoutGLextensions.cpp
SpoutReceiver.cpp
SpoutSender.cpp
SpoutSenderNames.cpp
SpoutSharedMemory.cpp
SpoutUtils.cpp
)
```
--------------------------------
### Output Architecture Destination
Source: https://github.com/jlai/python-spoutgl/blob/main/vendor/SpoutGL/CMakeLists.txt
Sets the output architecture destination (Win32 or x64) based on pointer size.
```cmake
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
set(OUTPUT_ARCH_DEST "Win32")
else()
set(OUTPUT_ARCH_DEST "x64")
endif()
```
--------------------------------
### Shared Spout Library Build
Source: https://github.com/jlai/python-spoutgl/blob/main/vendor/SpoutGL/CMakeLists.txt
Builds a shared (DLL) version of the Spout library.
```cmake
add_library(Spout SHARED ${SpoutSources} )
target_link_libraries(Spout PRIVATE ${SpoutLink} )
target_compile_definitions(Spout PRIVATE SPOUT_BUILD_DLL)
```
--------------------------------
### Output Directory Configuration
Source: https://github.com/jlai/python-spoutgl/blob/main/vendor/SpoutGL/CMakeLists.txt
Determines the output directory based on whether the generator is multi-config.
```cmake
get_property(GeneratorisMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
if(GeneratorisMultiConfig)
set(ConfigOutputDirectory $/)
endif()
```
--------------------------------
### Spout Link Libraries
Source: https://github.com/jlai/python-spoutgl/blob/main/vendor/SpoutGL/CMakeLists.txt
Specifies the libraries to link against for the Spout library.
```cmake
set(SpoutLink
opengl32
kernel32
user32
gdi32
winspool
comdlg32
comctl32
advapi32
shell32
ole32
oleaut32
uuid
odbc32
odbccp32
d3d9
d3d11
DXGI
Version
)
if(MINGW)
set(SpoutLink ${SpoutLink} winmm)
endif()
```
=== COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.