Coder Social home page Coder Social logo

kybuivan / sdl-tutorials Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 7.14 MB

Update the tutorials to the latest version of SDL

Home Page: https://kybuivan.github.io/sdl-tutorials/

License: MIT License

CMake 10.84% Makefile 0.03% C++ 79.99% Python 4.23% C 4.90%
sdl2 sdl2-image sdl2-mixer sdl2-net sdl2-ttf sdl2-tutorials sdl2-game sdl2-library

sdl-tutorials's Introduction

SDL Tutorials

C++ License Ubuntu CI Test Windows CI Test MacOS CI Test

This is a sdl tutorials. What you get:

  • Library, executable and test code separated in distinct folders
  • Use of modern CMake for building and compiling
  • External libraries installed and managed by CPM Package Manager
  • Unit testing using Catch2 v2
  • General purpose libraries: JSON, spdlog, cxxopts and fmt
  • Continuous integration testing with Github Actions and pre-commit
  • Code documentation with Doxygen and Github Pages
  • Tooling: Clang-Format, Cmake-Format, Clang-tidy, Sanitizers

Structure

├── CMakeLists.txt
├── app
│   ├── CMakesLists.txt
│   └── main.cc
├── cmake
│   └── cmake modules
├── docs
│   ├── Doxyfile
│   └── html/
├── src
│   ├── CMakesLists.txt
│   ├── my_lib.h
│   └── my_lib.cc
└── tests
    ├── CMakeLists.txt
    └── main.cc

Library code goes into src/, main program code in app/ and tests go in tests/.

Software Requirements

  • CMake 3.21+
  • GNU Makefile
  • Doxygen
  • CPM
  • MSVC 2017 (or higher), G++9 (or higher), Clang++9 (or higher)
  • Optional: Code Coverage (only on GNU|Clang): lcov, gcovr
  • Optional: Makefile, Doxygen

Building

First, clone this repo and do the preliminary work:

git clone https://github.com/kybuivan/sdl-tutorials.git
make prepare
  • App Executable
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build . --config Release --target main
cd app
./main
  • Unit testing
cd build
cmake -DCMAKE_BUILD_TYPE=Debug ..
cmake --build . --config Debug --target unit_tests
cd tests
./unit_tests
  • Documentation
cd build
cmake -DCMAKE_BUILD_TYPE=Debug ..
cmake --build . --config Debug --target docs
  • Output
JSON: 3.11.2
FMT: 90100
CXXOPTS: 3.1.1
SPDLOG: 1.11.0
SDL: 2.26.3
SDL_image: 2.6.3
SDL_mixer: 2.6.3
SDL_net: 2.2.0
SDL_ttf: 2.20.2


Usage Example:
[2023-05-30 13:32:54.175] [info] Welcome to sdl-tutorials v0.1.0

Welcome to sdl-tutorials v0.1.0

Usage:
  sdl-tutorials [OPTION...]

 arguments options:
  -h, --help          Print usage
  -f, --filename arg  File name
  -v, --verbose       Verbose output

For more info about CMake see here.

sdl-tutorials's People

Contributors

kybuivan avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.