GPiC++Stf Chapter 3 Part 2: Download and Set Up SDL and GLEW

in #tutorial6 years ago


Hello Everybody, Earth Otherwise here to continue our journey into Game Programming in C++: Start to Finish by Eric Yuzwa. Writing code to interface with different types of hardware and operating systems sucks and doesn't do much, so forget that shit and use SDL and GLEW, they do most of what we need right now and they have tonnes of addons if we need more.

Today we download and set up our directories so we can use SDL and GLEW. This is windows only 'cuz I ain't no casual and linux is a bitch to run games on. Some of this shit might not work on MacOS or Linux. You need that info, read the guides on the sites I'm linking to. Also, I say directory and directories a lot, but that has to many sylables. From this point forward and until the end of the post, directories are now buckets.

Now, I could just have you do this the easy way and download the engine and the project from my github account but if you're already here you've already chosen the harder path, so suck it. First, SDL 2.0; then GLEW. I think it's, like, 1.12 at this point or something. Links below.

Download the most recent development library bucket on the SDLn website. Gind the most recent GLEW version from the news section of the GLEW download page and follow the link to get the win32.zip file. Extract the sdl development file and the glew zip file, stick'em wherever, we'll be deleting them once we have what we want.

Make a new, empty project so that we have file locations for what we're about to do. Here we'll choose where our solution bucket will be. I keep mine right at the top of the C drive. It lets me use longer file names.

In that solution bucket make three new buckets. One may already exist. If so do not create a new one. These are Release, Debug, and Dependencies. You can change the name of the Dependencies bucket if you need to appease the snowflake within, just remember to substitute that name when I tell you to add the Dependencies bucket into an option.

Inside that Dependencies bucket create an include bucket, a lib bucket, and an SDL bucket. These names are also optional, but they're also standard, so stick with the standard names.

Open a second file browser window, or don't, and navigate to the sdl devel. Y'know, the one we got at the beginning, and looking at this script, I say sdl devel a lot, so I'm replacing it with the word squiggin. Deal with it. Copy the contents to the SDL bucket that we just made. Go into squiggin's include bucket and copy the files inside to an SDL bucket that we're making in our include bucket .

Go into the lib bucket in both our solution bucket and the squiggin bucket . In our lib bucket we will create another pair of buckets, Release and Debug. Some libraries come with special library files. We will store those files in the debug bucket .

In the squiggin bucket there is an x86 and an x64 bucket . We will the copying the .lib files from the x86 bucket into both our lib buckets. Then we need to back out to our solution bucket. Copy the .dll file that's in the squiggin's lib bucket into both our Release and Debug buckets.

And that's that for setting up our SDL files. Now we'll do the same for glew. Inside the include bucket within glew we'll find a GL bucket . Copy that into our include bucket. Then we pop into the lib folder, deeper into Release, and finally into Win32. Win32 and x86 are the same for our purposes. Copy the .lib files into both our lib buckets.

Finally, the .dll file in the glew bucket is stored in a different place than in the squiggin bucket. You'll find it in bin, Release, Win32. Copy the dll file into both our Release and Debug folders in the solution bucket. With that we now have the necessary files to run a program which uses SDL and GLEW. Next, we set up our projects so that they are actually able to use the code in these files.


▶️ DTube
▶️ IPFS

Coin Marketplace

STEEM 0.16
TRX 0.13
JST 0.027
BTC 58539.27
ETH 2627.11
USDT 1.00
SBD 2.40