O'Reilly logo

Mastering SFML Game Development 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

Preparing for additional materials

Drawing basic light streams is fairly nifty. But let's face it, we want to do more than that! Any additional processing is going to require further material information about the surfaces we're working with. As far as storing those materials goes, the Map class needs to allocate additional space for textures that will be used for this purpose:

class Map : ..., public LightUser { public: ... void Draw(MaterialMapContainer& l_materials, Window& l_window, int l_layer); protected: ... std::array<sf::RenderTexture, Sheet::Num_Layers> m_textures; std::array<sf::RenderTexture, Sheet::Num_Layers> m_normals; std::array<sf::RenderTexture, Sheet::Num_Layers> m_speculars; std::array<sf::RenderTexture, Sheet::Num_Layers> m_heightMap; ...

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