Git Product home page Git Product logo

sfml-project-template's Introduction

SFML Project Template

A cross-platform template for C++ SFML projects using cmake

How to use?

Clone

There are two ways to use this project template. You can either create a your own GitHub repo using this template (very similar to forking) or your can directly clone this repo on your local machine. Here are steps for both these ways:

  1. GitHub repo using template

    • Make sure you are logged into your GitHub account.

    • Click on the "Use this template" button.

      Step2

    • Provide a name for your new repo.

    • Click "Create repositoy from template".

    • Clone your new repo recursively.

    git clone --recursive <your-repo-link-here>
  2. Local repo by direcly cloning

    Step 1. Clone this repo recusrively using this command:

    git clone --recursive https://github.com/ufrshubham/sfml-project-template.git

Note: If you've already cloned this repo without using --recursive flag, just run git submodule update --init to update the submodules.

Code

  • Source files should be placed under src directory.

  • Header files should be placed under include directory. Header Version.hpp can be remove completely as it is just for demo.

  • Source code for SFML is pulled as a submodule under vendors/sfml and is built along with your code.

  • Assets like images, audio and fonts can be placed under resources directory. If you choose to use a custom directory for this, you'll have to handle how your executable finds those assets. The demo code in src/main.cpp programitically changes the working directory to the path where resources directory is located (see function modifyCurrentWorkingDirectory()).

Build

  • Make a directory for build in your project root.

    cmake -E make_directory ./build
  • Go to the build directory.

    cd build/
  • Generate project files (For debug builds, replace Release with Debug).

    cmake .. -DCMAKE_BUILD_TYPE=Release
  • Build (For debug builds, replace Release with Debug).

    cmake --build . --config Release
  • You should find the executables under build/bin

License

This project is released under MIT license. See LICENSE.md for details. Note that this does not cover any of the submodules located under vendor and assets located under resources.

sfml-project-template's People

Contributors

danilsem avatar ufrshubham avatar vor1c avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

danilsem vor1c

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.