O'Reilly logo

SFML Game Development By Example by Raimondas Pupius

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

The interface class

An interface, in its simplest meaning, is a container of elements. It's a window that can be moved around and scrolled and has all of the same features and event hooks as a regular element. Efficiency is also a great concern, as dealing with lots of elements in a single window is a definite possibility. Those problems can be dealt with by carefully designing a way of drawing elements at the appropriate time.

The way we want our interfaces to draw content is by using three separate textures for different purposes, as shown below:

The interface class
  • The background layer is used for drawing backdrop elements
  • The content layer is where all of the elements ...

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