Skip to content

Commit

Permalink
Vers 2.007.010
Browse files Browse the repository at this point in the history
Cumulative update complete from Beta branch
  • Loading branch information
leadedge committed Apr 7, 2023
1 parent f9c5b0c commit 33f597e
Show file tree
Hide file tree
Showing 99 changed files with 2,779 additions and 315 deletions.
Binary file modified BUILD/Binaries/Win32/Spout.dll
Binary file not shown.
Binary file modified BUILD/Binaries/Win32/Spout.lib
Binary file not shown.
Binary file modified BUILD/Binaries/Win32/SpoutDX.dll
Binary file not shown.
Binary file modified BUILD/Binaries/Win32/SpoutDX.lib
Binary file not shown.
Binary file added BUILD/Binaries/Win32/SpoutDX_static.lib
Binary file not shown.
Binary file modified BUILD/Binaries/Win32/SpoutLibrary.dll
Binary file not shown.
Binary file modified BUILD/Binaries/Win32/SpoutLibrary.lib
Binary file not shown.
Binary file modified BUILD/Binaries/Win32/Spout_static.lib
Binary file not shown.
Binary file modified BUILD/Binaries/x64/Spout.dll
Binary file not shown.
Binary file modified BUILD/Binaries/x64/Spout.lib
Binary file not shown.
Binary file modified BUILD/Binaries/x64/SpoutDX.dll
Binary file not shown.
Binary file modified BUILD/Binaries/x64/SpoutDX.lib
Binary file not shown.
Binary file added BUILD/Binaries/x64/SpoutDX_static.lib
Binary file not shown.
Binary file modified BUILD/Binaries/x64/SpoutLibrary.dll
Binary file not shown.
Binary file modified BUILD/Binaries/x64/SpoutLibrary.lib
Binary file not shown.
Binary file modified BUILD/Binaries/x64/Spout_static.lib
Binary file not shown.
Binary file modified Building the libraries.pdf
Binary file not shown.
20 changes: 15 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
# 31/12/20 - Add /MT build option #
# - Add DirectX library build option #
# 06/11/22 - Add Install option by Joakim Kilby #
# 13/01/23 - Default do not skip INSTALL project #
# Add necessary SpoutGL headers to SpoutDX includes #
#/-------------------------------------- . -----------------------------------\#

cmake_minimum_required(VERSION 3.15)
Expand Down Expand Up @@ -57,7 +59,7 @@ add_subdirectory(SPOUTSDK/SpoutDirectX/SpoutDX)
endif()

# Install option check boxes
OPTION(SKIP_INSTALL_ALL "Install headers and libraries" ON) # LJ - default skip all install
OPTION(SKIP_INSTALL_ALL "Install headers and libraries" OFF) # Default do not skip all install
OPTION(SKIP_INSTALL_HEADERS "Install headers" OFF)
OPTION(SKIP_INSTALL_LIBRARIES "Install libraries" OFF)

Expand All @@ -71,12 +73,12 @@ endif()
# Install options
if(NOT SKIP_INSTALL_ALL)

if(NOT SKIP_INSTALL_LIBRARIES) # LJ
if(NOT SKIP_INSTALL_LIBRARIES)

set(Spout2InstallTargets Spout Spout_static)

if(SPOUT_BUILD_SPOUTDX OR SPOUT_BUILD_SPOUTDX_EXAMPLES)
list(APPEND Spout2InstallTargets SpoutDX)
list(APPEND Spout2InstallTargets SpoutDX SpoutDX_static)
endif()

if(SPOUT_BUILD_LIBRARY)
Expand Down Expand Up @@ -117,7 +119,8 @@ if(NOT SKIP_INSTALL_ALL)
endif()


if(NOT SKIP_INSTALL_HEADERS)# LJ
if(NOT SKIP_INSTALL_HEADERS)

install(
FILES
SPOUTSDK/SpoutGL/Spout.h
Expand All @@ -139,7 +142,14 @@ if(NOT SKIP_INSTALL_ALL)
if(SPOUT_BUILD_SPOUTDX OR SPOUT_BUILD_SPOUTDX_EXAMPLES)
install(
FILES
SPOUTSDK/SpoutDirectX/SpoutDX/SpoutDX.h
SPOUTSDK/SpoutDirectX/SpoutDX/SpoutDX.h
SPOUTSDK/SpoutGL/SpoutCommon.h
SPOUTSDK/SpoutGL/SpoutCopy.h
SPOUTSDK/SpoutGL/SpoutDirectX.h
SPOUTSDK/SpoutGL/SpoutFrameCount.h
SPOUTSDK/SpoutGL/SpoutSenderNames.h
SPOUTSDK/SpoutGL/SpoutSharedMemory.h
SPOUTSDK/SpoutGL/SpoutUtils.h
DESTINATION
${CMAKE_INSTALL_PREFIX}/include/SpoutDX
)
Expand Down
Binary file modified DEMO/SpoutReceiver.exe
Binary file not shown.
Binary file modified DEMO/SpoutSender.exe
Binary file not shown.
4 changes: 1 addition & 3 deletions DEMO/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ Texture sharing with OpenGL progams requires compatibility for OpenGL/DirectX11

CPU sharing uses DirectX textures by way of system memory, which means that that an application with graphics that is not compatible with OpenGL/DirectX linking can still communicate with another on the same machine using compatible graphics hardware. This situation can occur with dual graphics laptop systems (NVIDIA “Optimus” or AMD “Dynamic Switchable Graphics”). This should be investigated using the respective program for graphics settings.

Use *Help > About* for details of the graphics system and compatibility for OpenGL/DirectX texture sharing. "Copy" will copy the information to the clipboard so that you can include that information in any problem report. "Logs" will open a folder with error log files. Look for "Spout Demo Sender.log" or "Spout Demo Receiver.log". These show details of program operation and will reveal any errors if they have occurred.

#### Receiver full screen

The demo receiver has proven useful as a full-screen display. The program can be run on different monitors and will show full screen on that monitor.
The demo receiver is useful as a full-screen display. The program can be run on different monitors and will show full screen on that monitor.

32 changes: 21 additions & 11 deletions INSTALL/README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@
Build the *INSTALL* project separately.\
An INSTALL folder is produced at the same level as the BUILD folder\
and contains separate folders for include and library files.\
### The CMake INSTALL project

The libraries can be built for a particular compiler using CMake.

Build the *INSTALL* project separately. An INSTALL folder is produced at the same level as the BUILD folder and contains separate folders for include and library files.

### The INSTALL folder

- bin (dynamic link libraries)
- lib (link libraries for dlls or static libraries)
- include (required header files)
- SpoutDX
- SpoutGL
- SpoutLibrary

The INSTALL folder included with the repository contains libraries built with Visual Studio 2022 /MD (without Visual Studio runtimes)

The INSTALL folder included with the repository contains\
libraries built with Visual Studio 2022\
x64 / Win32\
/MD (without Visual Studio runtimes)\
/MT (include Visual Studio runtimes)

The libraries can be re-built for a particular compiler using CMake.\
Build the *ALL_BUILD* project for a comprehensive build.\
Files are genereated in the BUILD folder.\
See the Readme file in that folder for details.
*Note that if building with the SpoutDX dynamic link library and the required header files are in the same folder, edit SpoutDX.h to refer to include files directly. See more information in SPOUTSDK/DirectX.*

### BUILD

Build the *ALL_BUILD* project for a comprehensive build. Files are genereated in the BUILD folder. See the Readme file in that folder for details.
Binary file added INSTALL/bin/VS2022/Win32/Spout.dll
Binary file not shown.
Binary file added INSTALL/bin/VS2022/Win32/SpoutDX.dll
Binary file not shown.
Binary file added INSTALL/bin/VS2022/Win32/SpoutLibrary.dll
Binary file not shown.
Binary file added INSTALL/bin/VS2022/x64/Spout.dll
Binary file not shown.
Binary file added INSTALL/bin/VS2022/x64/SpoutDX.dll
Binary file not shown.
Binary file added INSTALL/bin/VS2022/x64/SpoutLibrary.dll
Binary file not shown.
86 changes: 86 additions & 0 deletions INSTALL/include/SpoutDX/SpoutCommon.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
//
// Header: SpoutCommon.h
//
// Enables build of the SDK as a DLL.
//
// Includes header for common utilities namespace "SpoutUtils".
//
// Optional _#define legacyOpenGL_ to enable legacy draw functions
//

/*
Thanks and credit to Malcolm Bechard, the author of this file
https://github.com/mbechard
Copyright (c) 2014-2023, Lynn Jarvis. All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#pragma once

#ifndef __SpoutCommon__
#define __SpoutCommon__

//
// To build the Spout library as a dll, define
// SPOUT_BUILD_DLL in the preprocessor defines.
// Properties > C++ > Preprocessor > Preprocessor Definitions
//
#if defined(_MSC_VER)
#if defined(SPOUT_BUILD_DLL)
#define SPOUT_DLLEXP __declspec(dllexport)
#elif defined(SPOUT_IMPORT_DLL)
#define SPOUT_DLLEXP __declspec(dllimport)
#else
#define SPOUT_DLLEXP
#endif
#else // _MSC_VER
#define SPOUT_DLLEXP
#endif // _MSC_VERR

// Common utility functions namespace
#include "SpoutUtils.h"

//
// This definition enables legacy OpenGL rendering code
// used for shared texture Draw functions in SpoutGLDXinterop.cpp
// Not required unless compatibility with OpenGL < 3 is necessary
// Disabled by default for OpenGL 4 compliance
// * Note that the same definition is necessary in SpoutGLextensions.h
// so that SpoutGLextensions can be used independently of the Spout library.
//
// #define legacyOpenGL
//

//
// Visual Studio code analysis warnings
//

// C++11 scoped (class) enums are not compatible with early compilers (< VS2012 and others).
// The warning is designated "Prefer" and "C" standard unscoped enums are retained for compatibility.
#if defined(_MSC_VER)
#pragma warning(disable:26812) // unscoped enums
#endif


#endif
194 changes: 194 additions & 0 deletions INSTALL/include/SpoutDX/SpoutCopy.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
/*
SpoutCopy.h
Functions to manage pixel buffer copying
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Copyright (c) 2016-2023, Lynn Jarvis. All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#pragma once
#ifndef __spoutCopy__ // standard way as well
#define __spoutCopy__

#include "SpoutCommon.h"
#include <windows.h>
#include <stdio.h> // for debug printf
#include <gl/gl.h> // For OpenGL definitions
#include <intrin.h> // for cpuid to test for SSE2
#include <emmintrin.h> // for SSE2
#include <tmmintrin.h> // for SSSE3
#include <cmath> // For compatibility with Clang. PR#81
#include <stdint.h> // for _uint32 etc

class SPOUT_DLLEXP spoutCopy {

public:

spoutCopy();
~spoutCopy();

// Copy image pixels and select fastest method based on image width
void CopyPixels(const unsigned char *src, unsigned char *dst,
unsigned int width, unsigned int height,
GLenum glFormat = GL_RGBA, bool bInvert = false) const;

// Flip a pixel buffer in place
void FlipBuffer(const unsigned char *src, unsigned char *dst,
unsigned int width, unsigned int height,
GLenum glFormat = GL_RGBA) const;

// Correct for image stride
void RemovePadding(const unsigned char* source, unsigned char* dest,
unsigned int width, unsigned int height,
unsigned int source_stride, GLenum glFormat) const;

// SSE2 version of memcpy
void memcpy_sse2(void* dst, const void* src, size_t size) const;

//
// RGBA <> RGBA
//

// Copy rgba buffers line by line allowing for source pitch using the fastest method
void rgba2rgba(const void* source, void* dest, unsigned int width, unsigned int height,
unsigned int sourcePitch, bool bInvert = false) const;

// Copy rgba buffers line by line allowing for source and destination line pitch
void rgba2rgba(const void* source, void* dest, unsigned int width, unsigned int height,
unsigned int sourcePitch, unsigned int destPitch, bool bInvert) const;

// Copy rgba buffers of differing size
void rgba2rgbaResample(const void* source, void* dest,
unsigned int sourceWidth, unsigned int sourceHeight, unsigned int sourcePitch,
unsigned int destWidth, unsigned int destHeight, bool bInvert = false) const;

//
// RGBA <> BGRA
//

// Copy rgba to bgra using the fastest method
void rgba2bgra(const void* rgba_source, void* bgra_dest, unsigned int width, unsigned int height, bool bInvert = false) const;

// Copy rgba to bgra line by line allowing for source pitch using the fastest method
void rgba2bgra(const void* rgba_source, void* bgra_dest, unsigned int width, unsigned int height,
unsigned int sourcePitch, bool bInvert = false) const;

// Copy rgba to bgra line allowing for source and destination line pitch
void rgba2bgra(const void* source, void* dest, unsigned int width, unsigned int height,
unsigned int sourcePitch, unsigned int destPitch, bool bInvert) const;

// Copy bgra to rgba
void bgra2rgba(const void* bgra_source, void *rgba_dest, unsigned int width, unsigned int height, bool bInvert = false) const;

//
// RGBA <> RGB, RGBA <> BGR
//

// TODO : add RGBA pitch to all functions
// TODO : avoid redundancy

// Copy RGBA to RGB allowing for source line pitch
void rgba2rgb (const void* rgba_source, void* rgb_dest, unsigned int width, unsigned int height,
unsigned int sourcePitch, bool bInvert = false, bool bMirror = false, bool bSwapRB = false) const;

// Copy RGBA to BGR allowing for source line pitch
void rgba2bgr(const void* rgba_source, void* rgb_dest, unsigned int width, unsigned int height,
unsigned int sourcePitch, bool bInvert = false) const;

// Copy RGBA to RGB allowing for source and destination pitch
void rgba2rgbResample(const void* source, void* dest,
unsigned int sourceWidth, unsigned int sourceHeight, unsigned int sourcePitch,
unsigned int destWidth, unsigned int destHeight,
bool bInvert = false, bool bMirror = false, bool bSwapRB = false) const;

// Copy RGBA to BGR allowing for source and destination pitch
void rgba2bgrResample(const void* source, void* dest,
unsigned int sourceWidth, unsigned int sourceHeight, unsigned int sourcePitch,
unsigned int destWidth, unsigned int destHeight, bool bInvert = false) const;


// Copy RGB to RGBA allowing for destination pitch
void rgb2rgba (const void* rgb_source, void *rgba_dest, unsigned int width, unsigned int height, bool bInvert = false) const;

// Copy RGB to RGBA allowing for destination pitch
void rgb2rgba(const void *rgb_source, void *rgba_dest,
unsigned int width, unsigned int height,
unsigned int dest_pitch, bool bInvert) const;

// Copy BGR to RGBA
void bgr2rgba (const void* bgr_source, void *rgba_dest, unsigned int width, unsigned int height, bool bInvert = false) const;

// Copy BGR to RGBA allowing for destination pitch
void bgr2rgba(const void *rgb_source, void *rgba_dest,
unsigned int width, unsigned int height,
unsigned int dest_pitch, bool bInvert) const;

//
// RGB > BGRA
//


// Copy RGB to BGRA
void rgb2bgra (const void* rgb_source, void *bgra_dest, unsigned int width, unsigned int height, bool bInvert = false) const;

// Copy RGB to BGRA allowing for destination pitch
void rgb2bgra(const void *rgb_source, void *bgra_dest,
unsigned int width, unsigned int height,
unsigned int dest_pitch, bool bInvert) const;

// Copy RGB to BGRX using SSE
// Experimental SSE
void rgb_to_bgrx_sse(unsigned int w, const void* in, void* out) const;

// Copy BGR to BGRA
void bgr2bgra (const void* bgr_source, void *bgra_dest, unsigned int width, unsigned int height, bool bInvert = false) const;


// Copy RGBA to BGR
void rgba2bgr (const void* rgba_source, void *bgr_dest, unsigned int width, unsigned int height, bool bInvert = false) const;

// Copy BGRA to RGB
void bgra2rgb (const void* bgra_source, void *rgb_dest, unsigned int width, unsigned int height, bool bInvert = false) const;

// Copy BGRA to BGR
void bgra2bgr (const void* bgra_source, void *bgr_dest, unsigned int width, unsigned int height, bool bInvert = false) const;



protected :

void CheckSSE();
bool m_bSSE2;
bool m_bSSE3;
bool m_bSSSE3;

void rgba_bgra(const void *rgba_source, void *bgra_dest, unsigned int width, unsigned int height, bool bInvert = false) const;
void rgba_bgra_sse2(const void *rgba_source, void *bgra_dest, unsigned int width, unsigned int height, bool bInvert = false) const;
void rgba_bgra_sse3(const void *rgba_source, void *bgra_dest, unsigned int width, unsigned int height, bool bInvert = false) const;

};

#endif
Loading

0 comments on commit 33f597e

Please sign in to comment.