Search This Blog

Showing posts with label thecherno. Show all posts
Showing posts with label thecherno. Show all posts

Wednesday, January 15, 2020

Basic Project Configuration in Visual Studio 2019

As you might recall from a blog post a year or two ago, I like to ensure my projects in Visual Studio are set up in what I consider suitable and sensible ways.  I learned this from Yan Chernikov, a game programmer with EA, who runs a very well produced YouTube programming channel.

In this post I'm going to walk through the basic project configuration settings I set for all my projects.

First, you'll need to have a blank project created.

Create a new project

Create an empty C++ project

Name the project

A brave new world

Now, select the project name and click the "wrench" to get the project properties.


Under the General section of the Configuration Properties, set the following values:

  • Output Directory: $(SolutionDir)bin\$(Platform)\$(Configuration)\
  • Intermediate Directory: $(SolutionDir)bin\intermediates\$(Platform)\$(Configuration)\

Set directories
Hit Apply and then OK.  That's it!  Of course there are plenty of other things that we can configure, but these basic steps will ensure that any project we create will be stored and filed sensibly for any Configuration or Platform.

In future blog posts I'll cover how to set up SDL and other external libraries and even write some simple "Hello World" test programs.  Exciting, I know.  Stay tuned.

Tuesday, February 13, 2018

Smart Folks Who Need More Recognition

There are a few people who I've been reading about lately who I feel deserve more recognition.  These are folks who did amazing things generally in a crisis.  This list focuses on those who's work is tied in science and geekery and nerdy stuff.  Why?  Because I'm a geek and a nerd and it's my list.  Make your own.

I should probably point out that the list is not inclusive and may likely grow as time goes by.  It's also a non-ordered list.  I'm just adding names and links to information.  Why?  Because I'm lazy.  And, more importantly, because researching all these folks takes a lot more time than getting their names written down.  I'm not ignoring the irony of a list of people who deserve more recognition wherein I don't provide any further details about them beyond a terse summary.  For that I apologize.


  • Don Eyles - a young mathematician who worked at the MIT Instrumentation Lab during the Apollo days.  He was instrumental (sorry for the pun) in the success of the Apollo 14 moon landing.
  • Margaret Hamilton - She was director of software engineering at the lab where Don worked.  Women in STEM is something that I rally behind.  Margaret was doing cool stuff in a time when most women were not given the recognition they deserved.  Also, see below at the end of the list.
  • Martin "Quill18" Glaude - a YouTube and Twitch personality who does "Let's Play" videos.  His style of presenting is both educational and entertaining; something that can be tricky to pull off for those who aren't performers.  He also has a side channel where he does training videos on video game development, primarily with the Unity game engine framework.  His motto of "What could possibly go wrong?" is frequently challenged during game play.
  • Yan "TheCherno" Chernikov - another YouTube game developer who has an exceptionally well produced series of educational videos on C++ programming and OpenGL.  His approach to teaching programming is a refreshing change from the "Um.  Ah.  You see...  Just do this and don't worry," style that many other programming "instructors" pitch.
  • Tarn "Toady One" Adams - an indie game developer who, along with brother Zack "Threetoes", created the super FUN game of Dwarf Fortress.  I cannot tell you just how amazing the game is or what dedication these two guys show for the game.  If you like roguelike games and (especially) games that torment and abuse you as a player then you must get Dwarf Fortress.  Pick up the Lazy Newb Pack as well to save you some headaches.


  • Margaret Hamilton - This Margaret is the woman most people will recognize, if not by name then by her performance, as the Wicked Witch of the West in the original 1939 movie adaptation of L. Frank Baum's The Wizard of  Oz.

Setting Up Visual Studio 2017 CE

The Problem

I've grown tired of having my Visual Studio configuration getting jacked up between projects.  I like my settings the way they get set and I rarely ever want them changed.  I might not have the greatest workflow.  In fact, I'd wager that mine really sucks compared to professional programming shops.  However, some semblance of structure must hold between projects.

I know that the there are project settings files and user profiles and other mystical bits of data on my drive that store the needed information.  It's just that I find my time more valuable at coding than managing those haphazardly thrown files.

So this is just a blog so that I have some place to refer when I (once again) need to unscrew my configuration settings.  Enjoy.

The Solution

I start out by launching Visual Studio 2017 Community Edition.  That's easy.
Once it's finished opening up, it sits patiently for me to do something.


First up is to create a fresh new empty project.  File...New...Project or CTRL-SHIFT-N


Next is to name that project and create the solution.  I select Empty Project, fill in the project and solution names, provide the directory location, ensure that the "Create directory for solution" box is checked, and click on OK.  I locate all by projects in a directory that is easy to find and short enough to not get stupid.


After I click OK then VS presents me the shiny new solution explorer.  The "folders" here are not actually folders but, rather, filters.  They act like folders but don't physically reside on the hard drive as a folder does.  Source and header files will properly get sorted by these filters, but I want to ensure my code is properly kept on disk in a way that makes sense.


And for that, I use the "Show All Files".  If I right click on the project name (SFMLdemo in this case), I get a context menu where I click Add...New Folder.



And then I create "src" and "include" folders.  Inside those I create the appropriate source files.  Neat.  Tidy.  Switching between folder and filter views allows me to navigate easily around where my code resides.


So, then what?

Now that the files are sorted out and my Solution Explorer looks tidy what is there to do?

I find that the default settings in Visual Studio are lackluster.  I'm not a pro, but I know what I like.  When you build a project in Visual Studio, the defaults plonk files into weird locations.  I like to put the intermediates and executables into more sensible locations.

I open up the project properties and make some changes.


First to change are the Output Directory and Intermediate Directory for all configurations and platforms.

Output Directory is set to:

$(SolutionDir)bin\$(Platform)\$(Configuration)\

Intermediate Directory is set to:

$(SolutionDir)bin\intermediates\$(Platform)\$(Configuration)\


This keeps things cleanly divided for platform (x86, x64) and configuration (Debug or Release).

Would you like to know more?

Yan "TheCherno" Chernikov on YouTube has a fantastic video on how he sets up his Visual Studio experience.  It's what I followed.  So if you would like to hear this from someone with a bit more personality and experience than I, then I urge you to check out his video.  Check out his channel!  It's amazingly well produced by a pro game developer who teaches C++ and OpenGL.