Difference between revisions of "BasecodeCSE167S16"

From Immersive Visualization Lab Wiki
Jump to: navigation, search
(Starter Code for Programming Projects)
(Windows: Created Windows tutorial with NuGet package manager.)
Line 14: Line 14:
  
 
===Windows===
 
===Windows===
 +
First we'll be 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...
 +
#:[[File:Nugetpackagemanger.png]]
 +
# 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.
 +
#: [[File:nupengl.png|800px]]
 +
# Similarly, install the '''glm''' package.
 +
#: [[File:glm.png|800px]]
 +
# Now that we have all our packages, we just need to [https://en.wikipedia.org/wiki/Linker_(computing) 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'''.
 +
#: [[File:project_properties]]
 +
# Once in project properties, go to Linker->Input to prepend '''opengl32.lib;glu32.lib;''' to Additional Dependencies.
 +
#: [[File:opengl_lib_linker.png|800px]]
  
 
===Mac OSX===
 
===Mac OSX===

Revision as of 23:36, 28 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.

Starter Code on Lab Computer

Starter Code on Personal Computer

Windows

First we'll be configuring our Microsoft Visual Studio solution to work with OpenGL.

  1. Open the solution GLFWStarterProject.sln with Microsoft Visual Studio 2015.
  2. Open the NuGet Package Manager by selecting Tools->NuGet Package Manager->Manage NuGet Packages for Solution...
    Nugetpackagemanger.png
  3. 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.
    Nupengl.png
  4. Similarly, install the glm package.
    Glm.png
  5. Now that we have all our packages, we just need to Link against the OpenGL libraries.
  6. We can do that by going to our project's(note: NOT solution) Properties. Right-click on GLFWStarterProject project in the Solution Explorer.
    File:Project properties
  7. Once in project properties, go to Linker->Input to prepend opengl32.lib;glu32.lib; to Additional Dependencies.
    Opengl lib linker.png

Mac OSX

Install GLFW

Install GLM

Install GLEW