ebook img

SFML Game Development PDF

296 Pages·2013·3.728 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview SFML Game Development

SFML Game Development Learn how to use SFML 2.0 to develop your own feature-packed game Jan Haller Henrik Vogelius Hansson Artur Moreira BIRMINGHAM - MUMBAI SFML Game Development Copyright © 2013 Packt Publishing All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews. Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the authors, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book. Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information. First published: June 2013 Production Reference: 1170613 Published by Packt Publishing Ltd. Livery Place 35 Livery Street Birmingham B3 2PB, UK. ISBN 978-1-84969-684-5 www.packtpub.com Cover Image by Vivek Sinha ([email protected]) Credits Authors Project Coordinator Artur Moreira Amey Sawant Henrik Vogelius Hansson Jan Haller Proofreaders Dan McMahon Stephen Swaney Reviewers Brandon DeRosier Karol Gasiński Indexer Monica Ajmera Mehta Eyal Kalderon Graphics Ronak Dhruv Acquisition Editor Abhinash Sahu Edward Gordon Production Coordinator Lead Technical Editor Pooja Chiplunkar Mayur Hule Cover Work Technical Editors Pooja Chiplunkar Sanhita Sawant Priya Singh Nitee Shetty Dennis John Foreword I'm really honored to write the first words of this book, the very first one about SFML. When I started to write this library, in 2006, I couldn't imagine that it would become so much popular. Around 100,000 visitors per month, 100 new forum posts everyday... this is huge! And this is just the beginning; with the release of SFML 2.0, the library makes an important step forward. While SFML 1 is a constantly evolving (understand "unstable") API, SFML 2.0 is meant to be a robust, stable, and mature foundation for the future. And hopefully a solid base for more and more great games. Increasing popularity also means more effort from the authors to provide complete and quality documentation. Sadly, this is often overlooked by developers. Although I do my best to provide detailed tutorials for SFML, they are nothing more than an improved API documentation. Users often ask me where they can find a more complete guide to start programming games with SFML. And until today, I had nowhere to direct them to. But Artur, Henrik, and Jan did a great job to fill this hole. They have gathered their wisdom and experience into a unique book that covers the basics of game programming, as well as everything that SFML has to offer—from audio to network, through advanced graphics. What I really appreciate about this book is that it is written with the same philosophy that is behind SFML: good design, simplicity, and modern code. I hope you will enjoy reading this book as much as I did and find what you're looking for; whether you're a beginner who wants to learn game programming with SFML, or a more experienced programmer who wants to improve his design and technical skills. And don't hesitate to come to the SFML forum if you have questions or comments. I, the authors of this book, and all the community will be glad to answer you. Laurent Gomila Author of SFML Software Engineer, Tegesoft, France About the Authors Artur Moreira is a game development enthusiast who ultimately aims to start a new game development company in his home country. He has been programming games and game-related software for over 4 years. Most of the effort in that time was put in creating an open source game-making library with lots of flexibility and portability. The library is called Nephilim and is known for supporting all major desktop and mobile operating systems, making game development fully cross- platform and fast. Alongside this big project, he keeps making his own prototypes and games for educational and commercial purposes. Aside from the programming, he also puts some focus in creative areas such as 3D modeling, digital painting, and music composing. I would like to thank, first of all, my girlfriend for her patience and unconditional support every single time the writing was taking all of my time and energy. Also, I can't be thankful enough for the support of my parents and sisters, along with all the closest relatives, whose support is ever-present and always helpful. On the technical side, I would like to directly thank Jan Haller and Henrik Vogelius Hansson, the co-authors of the book, for their remarkable collaboration, skill, and teamwork. It's been always a pleasure to work with them. Henrik Vogelius Hansson has always been in love with both games and programming. He started his education fairly early and continued on into the indie scene with Defrost Games and their game Project Temporality. The next company that hired him was Paradox Development Studio where he got to work on titles such as Crusader Kings 2. Beside the game companies, Henrik has also been very active in the SFML community and has even provided a binding for Ruby called rbSFML. I would like to thank my co-authors, Jan and Artur, for the amazing cooperation and great times. I am also very happy and would like to thank my family that encouraged me to pursue this line of work. Also special thanks to my grandmother. Jan Haller is a Master's degree student of Electrical Engineering and Information Technology. In his free time, he occasionally develops games in C++. He is also interested in the creation of graphics and 3D models. In 2008, Jan stumbled upon SFML. Since then, he has used the library for many of his works. One of his bigger projects was a 2D Jump'n'Run game, where the character has to find its way through different levels, defeating enemies and collecting various items. During the years, Jan has actively participated in the SFML community, getting a lot of insights into the development of SFML 2. He has also written a C++ library called Thor, which extends SFML by ready-to-use features such as particle systems or animations. I would like to thank Laurent Gomila for the passion and huge efforts he invested into the Simple and Fast Multimedia Library. It has always been interesting to discuss with him about the library and its development process. I would also like to thank my co- authors, Artur Moreira and Henrik Vogelius Hansson, who have been a very nice team to work with. About the Reviewers Brandon DeRosier is a free software supporter, software engineer, and a hobbyist game developer living in the Greater Boston area. Driven by an early interest in programming, he took to the reverse engineering of his favorite games of his childhood; he would later write several small augmentation tools to run alongside these games. Over time, he developed his skills as a programmer—as well as an interest in music composition, animation, and interactive media. Currently, he is directing these skills and interests towards game design. As a member of the Free Software Foundation, he understands that the concealing of source code is unethical and regressive; dedicated to the digital rights of users everywhere, he has actively participated in the development and distribution of free software. Brandon is currently pursuing a Bachelor of Science degree in Computer Science at Wentworth Institute of Technology in Boston and takes pride in helping others learn. Occasionally, he gives lectures in classes and clubs, with hopes of encouraging interest in interactive media development with frameworks such as SFML and LWJGL. I'd like to thank my partner, Yamilah Atallah, for brainstorming game ideas with me, coming up with meaningful concepts and wonderful designs, and changing my life in so many positive ways; with this support, my interest in game development has grown. Karol Gasiński is a programmer, entrepreneur, and traveler living in Poland, Europe. He works as a Graphic Software Engineer at an Intel Research & Development facility, and has worked on 6 generations of Intel graphic cards. As a member of KHRONOS group, Karol contributes to the development of OpenGL and OpenGL ES Specifications—the industry standard for high-performance graphics. Outside of his work, Karol's biggest passion is game development and low-level programming. He has been associated with the games industry for over 6 years. In the past, he has worked on mobile versions of games such as Medieval Total War, Pro Evolution Soccer, and Silent Hill. Currently he is the founder and chairman of the Polish Conference on Computer Games Development—the biggest and fastest growing industry event in the country. Karol gives lectures on most Polish conferences and events for game developers including WGK, GameDay, SWPC, the DigitalFrontier course, IGK, and others. You can also meet him on GDC Europe and GDC San Francisco, where each year he gathers inspiration for his new games. Eyal Kalderon is a self-taught computer programmer and high school student. Having been introduced to the programming scene at a fairly young age, Eyal developed his early skills in Visual Basic and made a switch to C# early on. Eyal has made himself at home for several years now programming with C and C++ and using shell scripts to automate every task he finds boring. After trying SDL, Eyal switched to SFML in 2010, enjoyed it, and has been following its progress closely ever since. Understanding the power of print, having gained much from the Internet and professional publications, Eyal chose to erect 'nullpwd' (nullpwd.wordpress.com) in March of 2010, a casual software-centered blog that acts as an unintimidating front for various software topics, such as programming, penetration systems, and the current happenings of the open source community. www.PacktPub.com Support files, eBooks, discount offers and more You might want to visit www.PacktPub.com for support files and downloads related to your book. Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub. com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at [email protected] for more details. At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks. TM http://PacktLib.PacktPub.com Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can access, read and search across Packt's entire library of books. Why Subscribe? • Fully searchable across every book published by Packt • Copy and paste, print and bookmark content • On demand and accessible via web browser Free Access for Packt account holders If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view nine entirely free books. Simply use your login credentials for immediate access.

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.