Join Pablo Colapinto for an in-depth discussion in this video Setting up OpenGL and CMake in Windows, part of Learning OpenGL.
On Windows, we're going to want to make sure we have Visual Studio installed. Visual Studio includes most of the tools we're going to need for this course with the exception of CMake. CMake, we can download from the cmake.org website. In the resources section, download the Win32 installer. Launch the executable and follow instructions to install CMake. With CMake installed, we want to navigate to our Visual Studio Developer tools command prompt. This is different than the Windows built-in command prompt, since it points to different libraries that we're going to need to use.
Inside the developer command prompt for Visual Studio, we want to CD into our exercise files folder. Inside our exercise files folder, we want to make a new directory. We'll call it Visual Studio. We can CD into that new directory. Inside the Visual Studio folder, we can use CMake to generate a Visual Studio project, which will contain all the lessons for this course.
We type CMake, space, dash, capital G, space, quotes, Visual, space, Studio, space, and here we want to insert the addition of Visual Studio that we haven't installed. In my case, it's Visual Studio 12, so I put 12, and quotes, space, dot, dot, and hit return. CMake is now generating a Visual Studio pro project which will contain all the lessons for this course.
We navigate into our exercise files folder, and into our Visual Studio folder that we've created. We can click on any of these project files. We can open up the UAR OpenGL project file. On the right in our solution explorer, we can see a list of all the example files that we used in this course along with some example files that are included automatically by GLFW, our window in library. To follow along with the lessons in this course, open up the respective project file.
Open up the Source Files folder. Double-click on the dot cpp file inside. You'll be able to see the source code from the lessons. To compile a particular lesson, click on the top solution UAR OpenGL, and then the properties window. Scroll down to where it says start up project, and select the respective project. Go, then compile that, and you should be able to follow along.
In the lesson videos, I'll be using individual Xcode project files. The name of the example file will be at the top of my screen. To follow along, just pick the right example from the right hand side of your Visual Studio project.
- What is OpenGL?
- Setting up an OpenGL workflow
- Creating a window with GLFW
- Working with geometric primitives
- Rotating, translating, and scaling
- Understanding matrix transformations
- Creating mesh data structures
- Buffering mesh data
- Getting mouse and keyboard input
Skill Level Intermediate
Q: Why am I getting errors saying I don’t have GLEW installed when I try to create the Xcode projects with Cmake?
1) Download, Install, and Run Xcode
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
brew install glew
./bootstrap && make && make install
brew install cmake
cd Exercise Filesmkdir xcodecd xcodecmake -G "Xcode" ..