drawboard

Online drawboard (final project for Exercise on Operating Systems)

MIT License

Stars
10

drawboard

Final project for Exercise on Operating Systems

Features

  • TCP-based online multiplayer drawing board
  • Cross platform, support Windows / Linux / macOS
  • Random pencil color
  • Support undo operation

Preparing

git clone https://github.com/xqq/drawboard.git
cd drawboard
git submodule update --init

Windows build (mingw-w64 x86_64)

  • Install msys2 & necessary packages
pacman -S mingw-w64-x86_64-toolchain mingw-w64-x86_64-cmake mingw-w64-x86_64-SDL2

Windows build (MSVC)

  • Install packages by using vcpkg
vcpkg install sdl2:x86-windows
vcpkg install sdl2:x64-windows

macOS build

  • Use homebrew package manager
brew install cmake sdl2

Linux build (Debian-like distributions)

sudo apt-get install cmake libsdl2-dev

Build

MSVC Build

mkdir build
cd build
cmake .. -G "Visual Studio 15" -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=<PATH_TO_VCPKG>/scripts/buildsystems/vcpkg.cmake
cmake --build .

MSYS2 Mingw-w64 Build

mkdir build
cd build
cmake .. -G "MSYS Makefiles" -DCMAKE_BUILD_TYPE=Release
make -j8

Other toolchains

mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j8

Or using CLion (recommended)

Usage

Usage: drawboard [OPTIONS]
       --client <host> --port <port>
       --server <host> --port <port>

Start a drawboard server

./drawboard -s 0.0.0.0 -p 1919

Connect to a drawboard server

./drawboard -c 127.0.0.1 -p 1919
  • Press Ctrl+Z can Undo last draw operation

License

MIT License

Copyright (c) 2020 xqq <[email protected]>