![]() ![]() ![]() SDL is designed specifically for creating 2D games, but with OpenGL or Direct3D (Direct3D is a part of DirectX, a 3D graphics API developed by Microsoft), 3D games can also be implemented, but it is more troublesome. What is SDL? SDL is the abbreviation of "Simple DirectMedia Layer" (turned into Chinese is "simple direct media layer", which can only be unspeakable. Let's take a look at why we chose the SDL library instead of other libraries. So we choose a third-party library written in C language, which is just right for everyone who has just learned the basic knowledge of C language. If I want to introduce all the third-party libraries clearly, I'm afraid I won't be able to finish my life without eating or sleeping. We generally try to use powerful and free third-party libraries. Some are very good, some are not so good some are paid, and some are free. Unlike the standard library (the standard library can only achieve relatively basic functions), third-party libraries are written by other programmers, and there are countless third-party libraries in the world. Third party library (Third party Library): There is no library installed by default, you need to download it from the Internet, and then install it on your computer. If you want to know all the standard libraries, you can search Baidu: C Standard Library Although we haven't finished all the standard libraries, they have also used a lot. In the first and second parts, we have been using the C standard library, such as stdio.h, stdlib.h, string.h, time.h, etc. Standard Library: A library that is automatically installed with the installation of the IDE or compiler and can be cross-platform (running on almost all operating systems) (also the reason for the term "standard").ĭifferent languages correspond to different libraries, and the things defined in these libraries allow us to do some basic operations (such as the printf function). In fact, there are two types of libraries: What do we mean by saying that SDL is a "third-party library"? In this first lesson, we will take a look at the SDL library and learn how to install it on various platforms (Windows, Mac OS, and Linux). Of course, our tutorial can also stop here, and proudly say: "We have learned to program in C language", but we will always have regrets, after all, it has not yet jumped out of the "console" (Console) black box. After all, C language has no 5 years and 10 years of experience. However, it is best to cooperate with extra-curricular readings and some video tutorials to continue to learn C language in depth. Of course, some knowledge points are not too in-depth details, the space is not enough, if you want to in-depth, you may need to write a book. In the first two parts of the course, we have learned most of the functions of the C language. In this part, we will learn an open source library called SDL. In front of us, we have gone through a lot of hard work, and after a lot of hard work, it is time to enjoy the C language! After all, programming is a challenging and fun thing, but don't think programming is hard and boring. In this part, I assure you that we will "play" very happily. After all, the two previous small games are actually combat, but they are running on the console, but they are not fun! We can finally enter the actual combat part. Muhahaha, the first two parts are finally over, we formally enter the third part:įrom now on, the study of the theoretical knowledge of C language has come to an end. The third part of the first lesson: SDL development game installation SDL If a worker wants to do his job well, he must first sharpen his weaponĮxercise: Improve the first C language gameĮxercises: explain pointers in your own languageĭevelopment of 2D games with SDL library based on C languageĪctual combat: "Super Mary Push Box" game It will also take you to write three games in C language. After each part, there will be practice questions and the answers will be published. Our course is divided into four major parts. The third part of the second lesson preview: SDL development game creation window and canvas 2, the third part of the first lesson: SDL development SDL installed gamesģ. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |