There's one last part to this setup for Windows that involves editing the system environment variables. You may also want to run through this setup each time you make a new project until its easy to do and you understand the process. It's best to wait to set those up so you can practice the process later. Note You'll need to come back to reference this process a few times throughout the tutorials for several other libraries. In the top box, type in SDL2.lib SDL2main.lib.Go to Configuration Properties -> Linker -> Input -> Additional Dependencies.Next we need to configure the Linker input. It should look similar to this: C:\VisualStudioLibraries\SDL2-2.0.12\ lib\圆4 In the top box, add the library directory.Next we have to update the library directory. It should look similar to this: C:\VisualStudioLibraries\SDL2-2.0.12\ include In the top box, add the include directory location of the SDL folder you extracted.Go to Configuration Properties -> VC Directories -> Include Directories.At the top, change Configuration to All Configurations.From the top menu, go to Project -> Properties.To solve this, we need to add the library folder to the list of included directories. If you try to compile and run this code, you should see this error:Ĭannot open include file: 'SDL.h': No such file or directory If your default build setting is Debug x86, change it to Debug 圆4, since we'll be compiling for 64 bit systems. cpp file ( ctrl shift a) and copy/paste the code from SDL Basics into the empty file. Once extracted, start Visual Studio and create a new, empty C project. This will work just as well on a different drive, on the desktop, or anywhere else. My own files are directly in C:/ in a folder called VisualStudioLibraries. The location doesn't really matter, but it should be somewhere easy to find and memorable. Under Development Libraries, select the Visual C zip file for Windows. The next sections cover how to do this depending on your operating system. Using SDL reduces the code you have to write to a single function call, and it will be work on Windows, MacOS, Linux, Android, and iOS.īut before we can start writing code, we'll first have to set things up. Without it, you would need to write dozens of lines of code just to get a window open, and then it would only work on a single operating system. SDL simplifies much of the standard processes needed to build software with graphics. Few modern programs are run through a terminal interface like the command prompt, so learning how to use some sort of GUI library or framework is essential, and that's where SDL comes in. If you are not familiar with C , then the first step is to read the C Tutorial first.Īfter coding basic text-based programs, the natural next step is to create something with a Graphical User Interface (GUI). Note These tutorials assume you already know how to code with C and that you understand how classes work.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |