Updating the engine

Open the Engine.cpp file and add the highlighted code to load the sprite sheet texture at the end of the Engine constructor:

Engine::Engine() { // Get the screen resolution and create an SFML window and View Vector2f resolution; resolution.x = VideoMode::getDesktopMode().width; resolution.y = VideoMode::getDesktopMode().height; m_Window.create(VideoMode(resolution.x, resolution.y), "Thomas was late", Style::Fullscreen); // Initialize the full screen view m_MainView.setSize(resolution); m_HudView.reset( FloatRect(0, 0, resolution.x, resolution.y)); // Inititialize the split-screen Views m_LeftView.setViewport( FloatRect(0.001f, 0.001f, 0.498f, 0.998f)); m_RightView.setViewport( FloatRect(0.5f, 0.001f, 0.499f, 0.998f)); m_BGLeftView.setViewport( ...

Get Beginning C++ Game Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.