
The following course series has information regarding using each subsystem section of the simple Directmedia Layer 2 for cross-platform development using the C++ programming Language. If you want to learn about using SDL2 this course should provide some basic explanations for coding concepts which could hopefully reduce the rigor of software development. The following video series will be comprised of 3 sections the first of which will be dealing with the simple Directmedia Layer 2. Then the following section will be an active learning live coding session called Lets Try It! for different related areas of C++ and SDL2 . Finally in the final section there will be actual game programming for game such as : card games, board games, matching games, bug smash game , Frogger , Tetris , RPGs , platformers , Breakout , space shooter game , tank , top down shooter ,snake and a turn based game template which could be used for something else. If you would like to learn how to make some quick game projects , look no further than Easy SDL2 games in C++.
In the following course overview there will be a deep discussion around the idea of a live coding project using the Simple Directmedia Layer 2 for various applications other than games. The video contains documents sourced declarations and identification for most of the entire SDL2 application programming interface.
Games such as Pong ,Tic-Tac-Toe ,Tetris,Tank(Space) Shooter, Snake, Breakout ,Bug-Smash, Platformer,Top-Down-Shooter hopefully will be a good motivator for students learning SDL2 that trying to develop skills in C++.
The Introduction to SDL2 will include areas the regular subsystems ,data types ,functions , structures ,
hints, flags,variables,enumerations,classes all contain in the API. I hope you are as excited about creating video games as I am. In this SDL2 course students will learn about each subsystem of the Simple Directmedia Layer 2 as well as some extension libraries. Students will first Install the system then go over the basics of using the C++ programming language. If you are curious about using a compiler to code your first project or have some experience programming , I hope this video will be useful to you on your future journey as a developer.
As a review from the last video C++ Programming will be centered about the event loop then a description of a basic game loop using the C++ control structures , data types, and operators and using pointers. Some ideas in this portion of the video will be centered around debugging basic math operations to control the SDL2 Window with logic. Later there will be a template for constructing a complete basic graphical applications using easy to learn SDL2 Features.
If you are having none math related quetions about functions in C++ this video had a quick overview of creating an manipulating code for your projects. C++ Programming in SDL2 can be much more interesting if there are features to manipulate the Window. If there are question concerning enumerations , animation and user defined
functions this section could be useful for learning how to regulate the frames per second and other task such as swapping variables. There will always be other information concerning declaring multiple variables and some basic user input structuring schemes. In this section students will learn also be reminded about the event loop and possible structuring for creating a project using the C++ programming language. .
The Simple Directmedia Layer 2 has various Input support systems for not just only the Keyboard and mouse like input devices but also for gamepads and joysticks and touch devices and much more. Developers can also text to the screen using the extension library called SDL2_TTF which supports independent font formats which could change the entire look of a project. The video will also talk about mouse motion and click states for those of you familiar with keyboard bounce also applies to many other API like libraries. There will also be information about getters and setters in C++ for future classes .
There are several ways to make and or manipulate graphics using the Simple Directmedia Layer 2 other than using OpenGL or Vulkan along with the API. There is another SDL2 extension library that supports other primitives called SDL_GFX. If you choose to program a basic pong game template you could easily construct assets using this library such as drawing the board or any other type of geometric feature of the game. Show game score could be accomplished using other library add-ons with a bit of help from knowledge about the coordinate systems in each API. Also SDL2 supports colors in hexadecimal notation and formats for RGB values to manipulate pixel information which could be useful later for those interested in shader programs.
If you discovered how easy it could be to start drawing these new images on screen using SDL2. Like C++ and other programming languages the Simple Directmedia Layer 2 has support for reading or streaming information from external file types. In this section students will learn about how to manipulate various input types for event driven style programs where information is loaded after compile time. Students will get a brief overview of the expansive libraries contained herein the c++ languages such as the fstream file formatting features and how to access information from Arrays to Reading in Text Documents and parsing data and searching data base like systems. Some other terms will be discussed like blitting ,rotating ,cropping, scaling and about the sizes of textures .
Working with classes and header files could be complicated after a period of time without practice. Manipulating Textures with SDL_gpu and the GPU can help us maintain the Screen Aspect Ratio . Sound effects and music could be added to any type of application other than games using SDL2_mixer. Games such as Tetris only really need knowledge about arrays and making a quick matrix rotation can be simplified with a C++ style explication and or explanation .
C++ programming is quite robust and to explore SDL2 further we will add tilemaps to a possible game. Learning about arrays and reason for function overloading may help us simplify animation the various portions of the program. Orthographic and isometric tilemaps collision detection strategies are similar for 2D games. Using the tiled map editor or constructing ones own loading class can be simplified using SDL2. Making our own maps
without tools or constructing basic graphical map editor with the mouse can be accomplished by just using arrays.
In this section we will discuss a producer consumer methodology for processing memory related events in C++. Also some information about future coding projects in SDL2 featuring the outline for the BreakOut game . In C++ as well as other similar languages error handling can be down in several ways one of which is the Try catch blocks scene. Other issues such as common error messages and just general memory management
solution resolution strategies are addressed in this area.
In other simular Live Coding like Projects students will look at the Top Down Shooter to poutline some object oriented programming concepts. OOP has support for Base Class vs Derived Class ,Spawning Multiples of an object , Virtual Functions , Factories ,Polymorphism ,Singleton Design Patterns, Inheritance vs Friendship Multiple Inheritance, and Abstraction which are not always needed but OK to talk about for later uses.
This section will center around the possible in-cooperation of 2 Player games. There will be some information regarding Online Players using Hosting Server and Client SDL2_net . The Simple directmedia Layer also supports Viewports, Split-screen Cameras ,Multiple Windows ,Threads ,Semaphores and Locks/Wait features which may be useful in the construction of a more modern Top Down Shooter like online game engine.
In the final tutorial section students will be introduced to common Graphical User Interfaces and other tools such as widgets.The SDL2 API also has support for event driven programming functionality. Other system such as KiWi , kiss_SDL, QT GUI, FLTK ,Dear ImGui ,ImGUI_SDL will be discussed. Then finally there will be an
active review lesson called Lets Try It were we review some content to saw during the video series.
The terminal is required to install SDL2 in Linux.
The Vim editor is preferred by experienced programmers.
Some developers use systems such as cmake or bash files and numerous others to compiler projects on system which may not have a compiler on them.
The internet has a host of useful free tools for projects this is just a few examples which may make creating resources for projects easier.
Instead of paying someone to create resources lets experiment with some free tools and see how those graphical assets fit into our potential SDL2 projects.
Many operating system support the CobeBlocks compiler and the Integrated development environment (IDE )has many features of other similar tools.
If you are using the terminal this may be useful to user using g++ .
Lets get something on the screen using SDL2 or C++ for that matter.
Lets look at some variables for the language and what we can do with them in SDL2.
In this section we will look at doing some math in C++ for our SDL2 projects.
The control structures compiled with relational operators and logical operators are useful in many security applications.
Maybe we want our projects to be displayed inside different types of window settings.
Many application programming interfaces (APIs) have event loops lets look at a simple example for a game project.
Since the rendering and processing hardware is not the same on all devices the least we could do is regulate the frames per second so that the application run consistently. In this section we look at some simple implementations in C++ and SDL2 to accomplish the task.
In this section we will register keyboard presses and send the information to the terminal window.
In this part of the video we will just put a .bmp formatted image on screen using SDL2.
In this section we will explore how to render a .png formatted image by using the SDL2_image extension library for SDL2.
SDL2 has an additional library add-on for adding support for a variety of smaller sound formats or better quality audio formats for a project.
If you ever wondered how they put that the text font on screen inside a video game area we will try orienting it in this video.
There are usually two types of servers people use for games UDP and TCP we will try to make a simple one using SDL2_net.
Suppose you wanted to randomize the output for a card game. In this section we will just play around in C++ and SDL2 and see if our card hand is worth playing this game.
In SDL2 there are enumerations a common parts of many programs in C++.
There are Unions ans such in SDL2 as well but lets look at what they are in this video and perhaps how to use one or more.
If you are trying to implement a Singleton you will have to use it. So lets talk about using the Typedef from C++.
Well if I wanted to save a game or write my progress to file or load a game map this might be useful for you using SDL2.
Maybe I wanted to sort some numbers or arrange a list of names. With arrays we can store a collection of items in SDL2 as well as in C++.
In this section we will look at each operator in C++.
With SDL2 you can also change the color of the background.
You can append strings together using concatenation in C++.
With pointers we can use alias to save space by not making new variables for similar actions in our program.
C had structs lets look at using them in C++ for our SDL2 projects.
Suppose we wanted to make a choice based on a particular datum feature.
With functions we can do more lets see how,
Lets get out of the main function we are done testing.
If we knew we had a variable or piece of mathematics that had no reason to change we could store it somewhere else.
Lets try to use a Union for SDL2.
Lets use a template for SDL2.
Lets make a namespace for SDL2 features in a program.
If we have information in private or protected classes at times we may need to check for access.
Working with Classes.
Lets make a friend function in SDL2.
Basic polymorphism in SDL2.
Lets Inherit a feature from a class in SDL2.
Multi-threading is not so important in 2D game programming but it is useful for other types of applications.
Lets store something using a Vector in SDL2 and access the data members contained herein.
Lets make something using push , pop and peak in SDL2 and C++.
Lets do something using some Linked List examples using SDL2
When creating simple Artificial intelligence a low search is fine when the search domain is small.
Well maybe I could just use an algorithm to display what I wanted on screen instead of hard coding it.
Suppose i could sort elements , can we watch them being sorted?
Why not have an additional window?
If i wanted to divide the rendering regions.
If i wanted to select a region or outline something this might be useful.
There may be times when I want to place colored pixel points on screen for a task.
With the mouse in SDL2 motion clicks and presses can be performed.
Well lets make the screen appear to move while we walk in a direction.
Suppose i wanted to turn a tank or plane.
If i have a sprite sheet i would need to cut out the right set of images for the player and tile image objects.
I might be working for some company developing a simulation suppose I wanted to see certain output on different displays.
If i wanted to use OpenGL later i might need to set it up first.
Lets look at the say SDL2 does collision detection with functions and also how we could do it ourselves using good old C++ programming.
Lets try to read in a game controller for a simple project.
Other devices can register player actions based on the amount of pressure applied to the controls.
Many new controls and handheld console have a screen which can be interacted with.
Maybe i want to capture some action sequence in my game to show my friends.
Red green and blue can be changed to make other colors.
If you are thinking about card games or making an inventory system how would i pick up the potions and put them somewhere.
I want to play this on maybe a handheld later so how would i change this screen and text to match that device.
State machines are important not just for games you can use them to model other types of systems.
Lets spawn enemies and save memory doing so.
Singletons ensure that only one instance occurs at at time.
Lets look at how these client server application should kind of look put together for a modern game.
If might be okay if the game did not just start when I turned it on. In this section we will look at setting up a basic menu.
If you are using polymorphism or other features of OOP programming maybe i want to extend the player's functionality to other living entities in the game world.
Everything shoots in a video game maybe my player should be able to as well.
It would be a good idea if i knew how many hits or how much ammo the player had left on screen.
Lets look at a state manager to and how to cycle back and forward inside the system.
Suppose the level was over and maybe I won the stage or lost the level then how do you transition?
If i wanted to fight a boss in a video game ,maybe I can only hit the head or the hands.
Lets make a camera that follows the player.
If you play games made for the Gameboy or other handheld consoles you may want to read some dialog from a text box.
In the following lesson we will quickly create a matching game using the Simple Directmedia Layer 2.
In the following lesson we will quickly create a card game using the Simple Directmedia Layer 2.
In the following lesson we will quickly create a board game using the Simple Directmedia Layer.
In the following lesson we will quickly create a pong game using the Simple Directmedia Layer 2.
In the following lesson we will quickly create a Breakout game using the Simple Directmedia Layer 2.
In the following lesson we will quickly create a Frogger game using the Simple Directmedia Layer 2.
In the following lesson we will quickly create a snake game using the Simple Directmedia Layer.
In the following lesson we will quickly create a bug smasher game using the Simple Directmedia Layer 2.
In the following lesson we will quickly create a tank like game using the Simple Directmedia Layer 2.
In the following lesson we will quickly create a platformer game using the Simple Directmedia Layer.
In the following lesson we will quickly create a space shooter style game using the Simple Directmedia Layer 2.
In the following lesson we will quickly create a Tetris game using the Simple Directmedia Layer 2.
In the following lesson we will quickly create a basic top down shooter style game using the Simple Directmedia Layer 2.
In the following lesson we will quickly create a RPG with a basic combat system using the Simple Directmedia Layer 2.
In the following lesson we will quickly create a basic fighting game using the Simple Directmedia Layer 2.
In Easy SDL2 Games in C++ students will mainly learn about the Simple Directmedia Layer 2 and how to structure basic game applications. SDL2 grants access to low level hardware features for users to develop software using this Application Programming Interface. There is also information contain herein about how to program in the C++ programming language which is useful for those new to the software development scene. The course is a description based structuring of projects using SDL2 also information about other similar APIs for use along side the other systems. The course has 12 parts which are centered around the construction of several game projects. In this lengthy course series students will learn about making simple games such as Snake, Tetris , Breakout , Tank, Space Shooter , Platformer , Top Down Shooter and others. Students should have required resources for using a modern programming configuration to be effective in this course. The Simple Directmedia Layer 2 is a lengthy library with many features to explore and learn. SDL2 can also be combined with other programming languages and tools which may be more helpful for those making other varieties of simulations or system based development. Those interested in learning about SDL2 may find something new here.