Coder Social home page Coder Social logo

kongqx / libsdl2pp-tutorial Goto Github PK

View Code? Open in Web Editor NEW

This project forked from libsdl2pp/libsdl2pp-tutorial

0.0 2.0 0.0 75 KB

Tutorial for libSDL2pp, C++11 bindings/wrapper for SDL2

License: Creative Commons Zero v1.0 Universal

CMake 5.33% C++ 94.67%

libsdl2pp-tutorial's Introduction

libSDL2pp tutorial

Build Status


Screenshot

Here's tutorial for libSDL2pp, C++11 bindings/wrapper for SDL2. It covers core functionality of the library, including initialization and window construction, loading image files, sprite and text rendering, animation, and event handling trying to demonstate library features in as little code as possible.

Lessons

The tutorial is split into lessons, which demonstrate gradual development of a simple application resembling a platformer game.

  • lesson00: SDL library initialization, window creation, image loading and rendering
  • lesson01: picking specific sprite from an image atlas
  • lesson02: main loop, event processing
  • lesson03: timing and animation
  • lesson04: keyboard control
  • lesson05: texture generation
  • lesson06: alpha blending and color modulation
  • lesson07: text rendering

Each lesson adds some lines to the code and, thus, functionality to the application. You can explore these lessons sequentially starting from the first one (in which you might find e.g. git diff lesson00.cc lesson01.cc helpful to see what was added by the next lesson), or just jump straight to the last one and see all bits at once.

Building

To build executables from these lessons, you need cmake, SDL2, SDL2_image and SDL2_ttf libraries and corresponding development files.

To build the tutorial, run

cmake . && make

which will produce a set of binaries: lesson00 .. lesson07.

Author

License

Lesson code is licensed under CC0. Bundled data files have separate licenses, see COPYRIGHT files under data/.

libsdl2pp-tutorial's People

Contributors

amdmi3 avatar

Watchers

James Cloos avatar kongqx 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.