O'Reilly logo

SFML Essentials by Milcho G. Milchev

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 1. Getting Started with SFML

In this chapter, we will explore the window and graphic modules of SFML and focus on strengthening our basics. We will also see how a typical game loop looks like in SFML, and how we can handle input to manipulate shapes on the screen.

In this chapter, we will cover:

  • Window creation
  • The game loop
  • Event handling
  • Shape rendering and transformations

Creating windows

The first thing you would probably want to do when you start developing a game is open a window. In SFML, this couldn't have been made any easier. Only one line of code is necessary to create a window:

Creating windows

Tip

Downloading the example code

You can download the example ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required