A C++ implementation of the Distributed Interactive Simulation (DIS) protocol. Initially generated with xmlpg.
-
CMake is required to build the platform specific projects. It can be downloaded and installed from http://cmake.org/
-
SDL2 and SDL2_net are required libraries to compile the examples. These can usually be install via Linux package managers. More details, and instructions for Windows are included below.
NOTE: Windows users will need to either add the DLL folders to their path, or copy the DLLs to the output directory (
Debug
).
- Run
mkdir build
- Run
cd build
- Run
cmake ..
- Optionally,
-DCMAKE_INSTALL_PREFIX=<custom-path-to-install>
to set a custom directory to install the bin, include, and lib output directories. - Run
make
- this will output the libOpenDIS6.so, and libOpenDIS7.so libraries in the build directory along with the Example Applications. - The below steps are optional
- Run
make package
to build Linux package files. Currently this will produce a Red Hat RPM package, Debian DEB package, and 2 compressed tarball (XZ, GZ). - Run
make install
to install bin, lib, and dir, intoCMAKE_INSTALL_PREFIX
WARNING:CMAKE_INSTALL_PREFIX
default can to somewhere/usr/local/
, if not specified with the-D
flag as shown in Step 3.1. If you're unsure where to install, and want to keep your/usr/local/
directory clean, runcmake .. -DCMAKE_INSTALL_PREFIX=./install
. This will causemake install
to create a local install directory, from which you can move files elsewhere at a later date.
- Open
CMake (cmake-gui)
via the the start menu. - Enter the open-dis-cpp directory path into the Source and Build fields.
- Click the
+ Add Entry
button and enter the following details: Name:SDL_INC_DIR
Type:PATH
Value:<SDL2-install-folder>/include
(if you follow the below SDL2 Windows Install Instruction this will beC:/SDL2/include
) - Click the
+ Add Entry
button and enter the following details: Name:SDL_LIB_DIR
Type:PATH
Value:<SDL2-install-folder>/lib/x64
(64 bit) or<SDL2-install-folder>/lib/x86
(32 bit) (if you follow the below SDL2 Windows Install Instruction this will beC:/SDL2/lib/x64
) - Click Configure and follow the prompts, selecting the correct generator (i.e. Visual Studio version).
- Click Generate
- Click Open Project - This should open the generates solution file in Visual Studio
- Build the Solution (
Ctrl + Shift + B
)
These steps were tested with Visual Studio 16 2019 (Community Edition).
Currently, only OpenDIS 6 and the Example Applications compile.
The library and executable files are output to a Debug
directory.
To run the executables, either the value of the SDL_LIB_DIR
variable should be added to your path,
or SDL2.dll
and SDL2_net.dll
need to be copied to the Debug
directory.
To quickly clean up CMake output files, use git clean -xdf
.
Note: Use with care if you are actually developing open-dis-cpp, as git clean
removes untracked files.
- premake5 is required to build the platform specific projects. Download it and make sure it's available on your path, or specify the path to it.
- Run
premake5 gmake
- Run
make config=release
- Run
premake5 vs2015
- Open the solution and build.
The latest doxygen docs for the Open DIS master branch can be found here.
Arch: sudo pacman -S sdl2 sdl2_net
Fedora: sudo dnf install SDL2-devel SDL2_net-devel
Ubuntu: sudo apt-get install libsdl2-dev libsdl2-net-dev
If you're unable to install the correct packages, try installing from source
These are the installation steps that have been tested with open-dis-cpp, however there are other methods for installation. Experienced users should feel free to customise their install.
-
Navigate to the SDL2 Download page, and download the latest Development Libraries.
Alternatively, the version tested with open-dis-cpp, 2.0.12-VC, can be downloaded from this direct link.
-
Extract the SDL2-devel-2.0.12-VC.zip file directly to your
C:\
. -
Rename the resulting
SDL2-2.0.12
folder toSDL2
. -
Add
C:\SDL2\lib\x64
to your System Path for 64-bit systems, or addC:\SDL2\lib\x86
for 32-bit systems.
-
Navigate to the SDL2_net project page, and download the latest Development Libraries.
Alternatively, the version tested with open-dis-cpp, 2.0.1-VC, can be downloaded from this direct link.
-
Extract the SDL2-devel-2.0.12-VC.zip
-
Copy the
include
andlib
directories from the resulting folder into youC:\SDL2\
folder
Run the following commands:
-
wget http://libsdl.org/release/SDL2-2.0.12.tar.gz
Or, Download via your favourite web browser.
NOTE: check the download page for new releases
-
tar -xvf SDL2-2.0.9.tar.gz
-
pushd SDL2-2.0.9/
-
./configure --prefix=/usr && make && sudo make install
-
popd
-
wget https://www.libsdl.org/projects/SDL_net/release/SDL2_net-2.0.1.tar.gz
Or, Download via your favourite web browser.
NOTE: check https://www.libsdl.org/projects/SDL_net page for new releases
-
tar -xvf SDL2_net-2.0.1.tar.gz
-
pushd SDL2_net-2.0.1/
-
./configure --prefix=/usr && make && sudo make install
-
popd