Difference between revisions of "BasecodeCSE167S16"
(→Starter Code for Programming Projects) |
(→Starter Code for Programming Projects) |
||
Line 65: | Line 65: | ||
#* cmake -DBUILD_SHARED_LIBS=ON . | #* cmake -DBUILD_SHARED_LIBS=ON . | ||
#* make | #* make | ||
− | #: [[File:OSX_XCode_Setup_Making_GLFW.png|800px]] | + | <!-- #: [[File:OSX_XCode_Setup_Making_GLFW.png|800px]] --> |
====Install GLM==== | ====Install GLM==== | ||
Line 77: | Line 77: | ||
#* cmake . | #* cmake . | ||
#* make | #* make | ||
− | #: [[File:OSX_XCode_Setup_Making_GLM.png|800px]] | + | <!-- #: [[File:OSX_XCode_Setup_Making_GLM.png|800px]] --> |
====Install GLEW==== | ====Install GLEW==== | ||
+ | Begin by downloading GLEW: http://glew.sourceforge.net/ | ||
+ | |||
+ | #Unzip the downloaded folder | ||
+ | #Drag and drop the glew folder in its entirety into your /Developer folder. Authenticate accordingly. | ||
+ | # Open a terminal | ||
+ | #* cd /Developer/glew | ||
+ | #* cmake . | ||
+ | #* make | ||
===Linux=== | ===Linux=== | ||
The staff doesn't officially support Linux, but the ingredients you'll need is GLFW3.x.x, GLM 0.9.x.x, and GLEW 1.10+.x. You might be able to find these libraries in your favorite package managers, but make sure the versions match. | The staff doesn't officially support Linux, but the ingredients you'll need is GLFW3.x.x, GLM 0.9.x.x, and GLEW 1.10+.x. You might be able to find these libraries in your favorite package managers, but make sure the versions match. |
Revision as of 09:46, 29 March 2016
Contents |
Starter Code for Programming Projects
The purpose of this web page is to introduce OpenGL programming and set up your computer so that you can begin developing OpenGL applications.
In order to display an image, you must create a drawing canvas, which is essentially a window. With OpenGL, you create a window and then create an OpenGL drawing context associated with that window, which allows you to use your video hardware to draw 3D objects directly into that window. Opening that window and creating the OpenGL context is cumbersome and varies from system to system. The purpose of GLFW is to simplify and unify this initial step.
The PCs in the computer lab already have GLFW and Visual Studio installed.
For your personal computer we will show you how to download and install GLFW and configure Visual Studio/XCode to use it.
Begin by downloading the starter code available here: https://github.com/CSE167Admin/CSE167-Starter-Code
Starter Code on Lab Computer
Starter Code on Personal Computer
Windows
The very first thing you'll be doing is downloading and installing the Microsoft Visual Studio 2015 Community Edition for free.
Once that is done and you have unzipped your starter code, we're ready to begin configuring our Microsoft Visual Studio solution to work with OpenGL.
- Open the solution GLFWStarterProject.sln with Microsoft Visual Studio 2015.
- Open the NuGet Package Manager by selecting Tools->NuGet Package Manager->Manage NuGet Packages for Solution...
- Make sure you're in the Browse tab. Search for nupengl and install the nupengl.core package (NOT nupengl.core.redist).
- If the install button is greyed out, make sure the GLFWStarterProject checkbox is on.
- Similarly, install the glm package.
- Now that we have all our packages, we just need to Link against the OpenGL libraries.
- We can do that by going to our project's(note: NOT solution) Properties. Right-click on GLFWStarterProject project in the Solution Explorer.
- Once in project properties, go to Linker->Input to prepend opengl32.lib;glu32.lib; to Additional Dependencies.
Mac OSX
First, let's make sure we have all of the starter code downloaded (linked above).
Once you have unzipped the project, open XCode and create a new project.
- Select Command Line Tool as the template for the new project.
- Name your project any name of your choosing.
- Upon completion, you should be presented with something like this:
- Let's open the directory enclosing our newly created XCode project alongside the unzipped starter code directory. Drag and drop the files as shown below.
- If presented with the option, replace the already existing files (main.cpp in this case)
All is good for now. We will come back to this later.
Next, make sure you have a recent version of CMake. You can download CMake from here: https://cmake.org/
Install GLFW
Begin by downloading GLFW: http://www.glfw.org/
- Unzip the downloaded folder
- Drag and drop the glfw folder in its entirety into your /Developer folder. Authenticate accordingly.
- Open a terminal
- cd /Developer/glfw-3.1.2
- cmake -DBUILD_SHARED_LIBS=ON .
- make
Install GLM
Begin by downloading GLM: http://glm.g-truc.net
- Unzip the downloaded folder
- Drag and drop the glm folder in its entirety into your /Developer folder. Authenticate accordingly.
- Open a terminal
- cd /Developer/glm
- cmake .
- make
Install GLEW
Begin by downloading GLEW: http://glew.sourceforge.net/
- Unzip the downloaded folder
- Drag and drop the glew folder in its entirety into your /Developer folder. Authenticate accordingly.
- Open a terminal
- cd /Developer/glew
- cmake .
- make
Linux
The staff doesn't officially support Linux, but the ingredients you'll need is GLFW3.x.x, GLM 0.9.x.x, and GLEW 1.10+.x. You might be able to find these libraries in your favorite package managers, but make sure the versions match.