Erik Yuzwa - Game Programming in C++: Start to Finish - Book Review - Flipkart
Game Programming in C++: Start to Finish by Erik Yuzwa
Welcome to the exciting world of game programming! If you're already familiar with the C++ programming language and want to learn how to program games, this book is for you. Game Programming in C++: Start to Finish will help you learn the popular techniques and practices behind today's games. Not only will you add a lot of theory to your game programming toolkit, but you'll also create a small basic game from scratch SuperAsteroidArena. While you'll focus on using the SDL and the OpenGL libraries to learn game programming, you'll also learn the essential Windows principles that you'll need to create just about any kind of game with any other API such as DirectX.
game programming in c start to finish by erik yuzwa pdf 31
This book was written by Erik Yuzwa, a professional computer programmer with over seven years of experience. He holds a Bachelor of Science in Computer Science and has founded Wazoo Enterprises Inc. to pursue creating game programming related tutorials and articles. He has also published several other books on game development, such as Beginning OpenGL Game Programming and Multi-Threaded Game Engine Design.
Why Learn Game Programming in C++?
C++ is one of the most widely used programming languages in the world, especially for developing complex applications such as games. C++ offers many advantages for game programmers, such as:
It is fast and efficient, allowing you to squeeze every bit of performance out of your hardware.
It is flexible and powerful, giving you full control over memory management, data structures, algorithms, and object-oriented design.
It is portable and cross-platform, enabling you to write code that can run on different operating systems and devices.
It is compatible and interoperable, allowing you to use existing libraries and frameworks written in C or other languages.
It is mature and stable, having a long history of development and support from the community and the industry.
However, C++ also comes with some challenges and pitfalls, such as:
It is complex and verbose, requiring you to write a lot of code and deal with low-level details.
It is error-prone and unsafe, exposing you to potential bugs, crashes, memory leaks, and security issues.
It is inconsistent and outdated, having some features and syntax that are obsolete or deprecated.
It is lacking and incomplete, missing some features and functionalities that are common in modern languages.
Therefore, learning C++ for game programming requires a lot of dedication, patience, and practice. You need to master the fundamentals of the language, as well as the best practices and conventions for writing clean, efficient, and maintainable code. You also need to keep yourself updated with the latest standards and trends of the language, such as C++11, C++14, and C++17.
What You Will Learn from This Book
This book covers C++ game programming from start to finish, using OpenGL and SDL as the main libraries for graphics and multimedia. You will learn how to create a Windows application, set up a game engine, render 3D graphics, add animation effects, play sound and music, implement collision detection, create multiplayer games, and more. You will also learn how to design and manage your game projects using timeboxing, scripting, debugging, and documentation tools.
Chapter 1: Game Technologies
In this chapter, you will get an overview of the game industry and the tools and libraries used for game programming. You will learn about the different types of games, such as casual, hardcore, indie, and AAA games. You will also learn about the different roles and skills involved in game development, such as programmers, artists, designers, testers, and producers. You will also get familiar with some of the popular game engines and frameworks available in the market, such as Unreal Engine, Unity, GameMaker Studio, and Godot Engine. Finally, you will learn how to choose the right tools and libraries for your game project, depending on your goals, preferences, and budget.
Chapter 2: Design Fundamentals
In this chapter, you will learn the basics of game design and project management. You will learn how to define the concept and scope of your game, as well as the target audience and platform. You will also learn how to create a game design document (GDD), which is a blueprint that describes the features and functionalities of your game. You will also learn how to use timeboxing, which is a technique that helps you plan and execute your game project in short iterations. You will also learn how to use scripting languages, such as Lua and Python, to create and modify your game logic without recompiling your code.
Chapter 3: Windows Programming
In this chapter, you will learn how to create a Windows application and handle user input and events. You will learn how to use the Win32 API, which is a set of functions and structures that allow you to interact with the Windows operating system. You will also learn how to use Visual Studio, which is an integrated development environment (IDE) that helps you write, compile, debug, and run your code. You will also learn how to create a window class, a window procedure, a message loop, and a message handler. You will also learn how to process keyboard and mouse input from the user.
Chapter 4: Introduction to OpenGL
In this chapter, you will learn how to set up and use OpenGL for rendering graphics. OpenGL is a cross-platform API that allows you to access the graphics hardware and perform low-level operations on it. You will learn how to initialize OpenGL using SDL or GLUT (GL Utility Toolkit). You will also learn how to use OpenGL commands to draw basic shapes, such as points, lines, triangles, and polygons. You will also learn how to use OpenGL states and modes to control various aspects of rendering, such as color, depth testing, blending, culling, lighting, and shading.
Chapter 5: Introduction to SDL
In this chapter, you will learn how to use SDL for cross-platform development and multimedia support. SDL is a library that provides a simple interface for accessing various features of your system, such as video display, audio playback, input devices, timers, threads, and network sockets. You will learn how to initialize SDL and create a window with an OpenGL context. You will also learn how to use SDL functions to load images and fonts from files and display them on the screen. You will also learn how to use SDL events to handle user input from keyboard, mouse, joystick, or gamepad.
Chapter 6: Creating a Game Engine
In this chapter, you will learn how to design and implement a game engine using object-oriented programming. A game engine is a software framework that provides the core functionalities and services for your game application. You will learn how to create a game engine class that encapsulates the main components of your game system, such as window creation, OpenGL initialization, SDL initialization, event handling, game loop, and resource management. You will also learn how to create other classes that represent the main entities of your game world, such as camera, scene, node, mesh, material, texture, and light. You will also learn how to use inheritance, polymorphism, and composition to organize your code and reuse functionality.
Chapter 7: 3D Programming with SDL and OpenGL
In this chapter, you will learn how to create a 3D scene and apply lighting, textures, and transformations to it. You will learn how to use matrices and vectors to perform geometric operations such as translation, rotation, scaling, and projection. You will also learn how to use quaternions to represent and manipulate orientations in 3D space. You will also learn how to use OpenGL functions to set up the viewing and projection matrices, as well as the modelview matrix stack. You will also learn how to use OpenGL functions to enable and configure lighting and texturing for your 3D objects.
Chapter 8: Animation Effects
In this chapter, you will learn how to use particle systems, sprites, and shaders to create dynamic effects for your game. You will learn how to create a particle system class that can generate and update a large number of particles with different attributes such as position, velocity, color, size, and lifetime. You will also learn how to create a sprite class that can display and animate a 2D image with different frames and states. You will also learn how to create a shader class that can load and compile a custom program written in GLSL (OpenGL Shading Language) that can manipulate the vertex and fragment data of your 3D objects.
Chapter 9: Audio Programming
In this chapter, you will learn how to use OpenAL and SDL_mixer to add sound and music to your game. OpenAL is a cross-platform API that allows you to access the audio hardware and perform 3D spatial sound effects. SDL_mixer is a library that provides a simple interface for loading and playing various audio formats, such as WAV, MP3, OGG, and MIDI. You will learn how to initialize OpenAL and SDL_mixer and create an audio engine class that encapsulates the main components of your audio system, such as listener, source, buffer, and music. You will also learn how to use OpenAL and SDL_mixer functions to load and play sound and music files from disk or memory.
Chapter 10: Collision Detection
In this chapter, you will learn how to implement various methods of collision detection and response. Collision detection is the process of determining whether two or more objects are intersecting or overlapping in space. Collision response is the process of resolving the collision by applying appropriate actions, such as bouncing, sliding, or breaking. You will learn how to use bounding volumes, such as spheres, boxes, and cylinders, to approximate the shape and size of your objects and perform fast and simple collision tests. You will also learn how to use ray casting, which is a technique that involves shooting a ray from a point in a direction and checking whether it hits any object along the way. You will also learn how to use polygon intersection, which is a technique that involves checking whether two polygons share any common area. You will also learn how to use impulse-based physics, which is a technique that involves computing the impulse, or change in momentum, of the colliding objects and applying it to their velocities.
Chapter 11: Networking
In this chapter, you will learn how to use SDL_net for creating multiplayer games over the internet. SDL_net is a library that provides a simple interface for accessing various network features, such as sockets, packets, channels, hosts, ports, and protocols. You will learn how to initialize SDL_net and create a network engine class that encapsulates the main components of your network system, such as server, client, peer, connection, message, and session. You will also learn how to use SDL_net functions to create and manage TCP and UDP sockets, send and receive packets of data, handle network events, and synchronize game states.
Chapter 12: Finishing the Game
In this chapter, you will learn how to polish and debug your game and prepare it for distribution. You will learn how to use Visual Studio tools, such as debugger, profiler, memory leak detector, and code analysis, to find and fix errors, optimize performance, and improve code quality. You will also learn how to use external tools, such as GIMP, Audacity, 3ds Max, Blender, and Tiled, to create and edit graphics, sound, models, animations, and maps for your game. You will also learn how to use SDL_image, SDL_ttf, SDL_gfx, SDL_rtf, SDL_console, SDL_gui, SDL_net2, SDL_collide, SDL_sound, SDL_mng, SDL_gfxPrimitives_font_16x16.h ,and other libraries to enhance your game with additional features and functionalities. Finally, you will learn how to package your game into an executable file or an installer that can be easily distributed to other users.
Conclusion
In conclusion, this book has taught you how to program games in C++ from start to finish, using OpenGL and SDL as the main libraries for graphics and multimedia. FAQs
Here are some frequently asked questions about the book and game programming in general:
What are the prerequisites for reading this book?
You should have a basic knowledge of C++ programming, such as variables, data types, operators, control structures, functions, classes, pointers, and references. You should also have a basic understanding of mathematics, such as algebra, trigonometry, and geometry. You should also have access to a Windows computer with Visual Studio installed.
What are the differences between OpenGL and DirectX?
OpenGL and DirectX are both APIs that allow you to access the graphics hardware and perform low-level operations on it. However, they have some differences in terms of features, performance, compatibility, and support. OpenGL is a cross-platform API that can run on various operating systems and devices. DirectX is a Windows-specific API that can only run on Windows platforms. OpenGL is an open standard that is maintained by the Khronos Group, a consortium of industry members. DirectX is a proprietary technology that is developed by Microsoft. OpenGL is more flexible and powerful, but also more complex and verbose. DirectX is more consistent and user-friendly, but also more restrictive and limited.
What are the advantages and disadvantages of using SDL?
SDL is a library that provides a simple interface for accessing various features of your system, such as video display, audio playback, input devices, timers, threads, and network sockets. SDL has some advantages and disadvantages for game programmers, such as: SDL is cross-platform and portable, allowing you to write code that can run on different operating systems and devices. SDL is lightweight and modular, allowing you to use only the components that you need for your game. SDL is compatible and interoperable, allowing you to use other libraries and frameworks with it. SDL is free and open source, allowing you to modify and distribute it as you wish. However, SDL is also limited and incomplete, missing some features and functionalities that are common in modern games. SDL is also low-level and abstracted, requiring you to write more code and deal with low-level details.
How can I learn more about game programming in C++?
There are many resources available online and offline for learning more about game programming in C++. Some of them are: Game Programming Patterns by Robert Nystrom, C++ for Game Programmers by Michael J. Dickheiser, Game Coding Complete by Mike McShaffry and David Graham, Game Engine Architecture by Jason Gregory, Introduction to 3D Game Programming with DirectX 11 by Frank Luna, OpenGL Programming Guide by John Kessenich et al., The OpenGL SuperBible by Graham Sellers et al., SDL Game Development by Shaun Mitchell, SDL 2.0 Cookbook by Jack Rieger, and The Game Developer's Website, The Game Programming Wiki, The Lazy Foo' Productions Website, The NeHe Productions Website, The GameDev.net Website, The Stack Overflow Website, The Reddit Website, The YouTube Website, The Udemy Website, The Coursera Website, The edX Website, and many others.
Where can I get the source code and resources for this book?
You can get the source code and resources for this book from the author's website: http://www.erikyuzwa.com/game-programming-in-c-start-to-finish/. You can also get them from the cover disc that comes with the book or from the Internet Archive website: https://archive.org/details/game-programming-in-c-start-to-finish-2006.
71b2f0854b