NuGet for Visual Studio 2013

Free A collection of tools to automate the process of downloading, installing, upgrading, configuring, and removing packages from a VS Project

https://visualstudiogallery.msdn.microsoft.com/4ec1526c-4a8c-4a84-b702-b21a8f5293ca

A console window will appear waiting you, to write what the packages you want to install in your project.

 Type: Install-Package nupengl.core and this will install FreeGLUT, GLFW and GLEW.https://www.nuget.org/packages/nupengl.core/ . Now, you are ready to go:D

Now we are ready to use OpenGL and create a new window in our next tutorial.

You can also install them separately. For example Install-Package freeglut and installs only FreeGLUT and Install-Package glew to install GLEW. If you want to install SDL you can write Install-Package SDL. It’s your choise. However in these tutorials we are using FreeGLUT. If you install them separately you have more control over libraries versions.

The required steps to prepare the OpenGL library in VS2013:

1. Right Click mouse on the project name -> Properties 2. From Configuration -> All Configuration 3. From Configuration Properties -> C/C++ -> General -> Additional Include Directories -> Edit C:\Users\user\Desktop\test\CGTut1\Dependencies\freeglut\include C:\Users\user\Desktop\test\CGTut1\Dependencies\glew\include 4. From Linker -> General -> edit C:\Users\user\Desktop\test\CGTut1\Dependencies\freeglut\lib C:\Users\user\Desktop\test\CGTut1\Dependencies\glew\lib\Release\Win32 5. From Linker -> Input -> edit glew32.lib freeglut.lib 6. Copy the file called " freeglut.dll " in the Debug folder

Then copy and paste the below code to test the running application: // ConsoleApplication1.cpp : Defines the entry point for the . //

#include "stdafx.h"

#include "C:\Users\user\Desktop\test\CGTut1\Dependencies\glew\glew.h" #include "C:\Users\user\Desktop\test\CGTut1\Dependencies\freeglut\freeglut.h" #include void display(void) { //Clear all pixels glClear(GL_COLOR_BUFFER_BIT);

//draw white polygon (rectangle) with corners at // (0.25, 0.25, 0.0) and (0.75, 0.75, 0.0) glColor3f(0.1, 0.4, 1.0); glBegin(GL_POLYGON); glVertex3f(0.25, 0.25, 0.0); glVertex3f(0.75, 0.25, 0.0); glVertex3f(0.75, 0.75, 0.0); glVertex3f(0.25, 0.75, 0.0); glEnd();

// Don't wait start processing buffered OpenGL routines glFlush(); } void init(void) { //select clearing (background) color glClearColor(0.0, 0.0, 0.0, 0.0);

//initialize viewing values glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(0.0, 1.0, 0.0, 1.0, -1.0, 1.0);

} int main(int argc, char **argv) {

// Initialise GLUT with command - line parameters. glutInit(&argc, argv);

//Set Display Mode glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);

//Set the window size glutInitWindowSize(450, 450);

//Set the window position glutInitWindowPosition(100, 100);

//Create the window glutCreateWindow("A Simple OpenGL Windows Application with GLUT");

//Call init (initialise GLUT init();

//Call "display" function glutDisplayFunc(display);

//Enter the GLUT event loop glutMainLoop();

return 0;

return 0; }

The out must be as follows: