Skip to content

Ohohcakester/gdg-sfml-workshop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Workshop Slides

SFML Sample Code

Expected Result:

sfml_sample

Compiling with SFML

SFML Download Page (Download the binary corresponding to your compiler, else it won't work)

The official setup instructions for SFML can be found here.

NOTE: Don't try to compile the SFML source code yourself, especially if you don't know what you are doing. Download a precompiled binary from the downloads page. You'll have a much, much easier time.

Below are some additional pointers for setting up SFML.

Windows:

Either

M1: Visual Studio [Recommended]

Install Visual Studio with C++, download the SFML binary for your Visual Studio version, follow all the setup instructions in the SFML tutorial.

Or

M2: MinGW / g++, from command line

Download MinGW 4.9.2, and download the SFML binary for MinGW from the downloads page. Make sure you add the bin folder for MinGW to your path so that you can use g++. Ask me if you don't know how to do that. Place the sfml contents in a folder called "sfml" in the same directory as your game code, and run these two lines to build:

g++ -std=c++11 -c *.cpp -I sfml/include
g++ -std=c++11 *.o -o Game -L sfml/lib -lsfml-graphics -lsfml-window -lsfml-system

Note: The game won't run if you don't put the .dll files from the sfml/bin directory into the same directory as your Game.exe

Mac OSX

Either

M1: Brew

Note: most convenient, but not recommended. Your compiled game will work on your computer only. (but okay if just for the workshop) Make sure you are able to use g++ on your terminal. Then install SFML via brew install sfml.

To compile your code, run these two lines:

g++ -std=c++11 -c *.cpp
g++ -std=c++11 *.o -o Game -lsfml-graphics -lsfml-window -lsfml-system

Or

M2: Xcode [Recommended]

The recommended way for setting up SFML on a Mac. Follow the instructions on the SFML tutorial.

Linux

M1: apt-get

Make sure you are able to use g++. Install SFML via sudo apt-get install libsfml-dev then run these two lines to compile.

g++ -std=c++11 -c *.cpp
g++ -std=c++11 *.o -o Game -lsfml-graphics -lsfml-window -lsfml-system

Versions

V0

v0

V1,V2

v1v2

V3

v3

V4

v4

V5

v5

V6

v6

V7

v7

V8

v8

Part 2 Versions

V9 - Camera

Add camera object - no visual change

V10 - Camera

v10

V11 - Camera

v11

V12 - Camera

Smooth camera movement

v12

V13 - SFX

Create Sfx abstract class - no visual change

V14 - SFX

/ v14

V15 - SFX

v15

V16 - Array Deletion

Regularly clean up inactive objects in array - no visual change

V17 - Menu

v17

V18 - Menu

v18

VFinal - Splitting

Split the game into multiple files. Game is exactly the same.

About

Resources for the Basic Low Level Game Development Workshop in C++/SFML

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published