Simple configuration of glfw + glad in vs2015 OpenGL development environment

A tutorial learning OpenGL reference is
this tutorial is based on GLFW (window) + glad (cross-platform), the following VS2015 a simple method of environment configuration:
1. New projects
Simply create an empty project and add a blank CPP file.
2. Add the Nupengl Core library
Add method: VS->; Tools – & gt; NUGET Package Manager -> Package management console
and then in the bottom of the Package management console input Install – Package nupengl. Enter the core instruction can
at this point, your this project has been configured glut GLFW glew
3. The configuration is glad
If you don’t need glad, you can skip this step, but glad is used in the tutorial above, so it should also be configured incidentally:

Open the Glad online service, set the Language to C/C++ and, from the API options, select OpenGL version 3.3 and above (we will use version 3.3 for this tutorial, but newer versions will work just fine). Generate
ader is selected. Generate
loader is selected. Generate
loader is selected. Ignore the Extensions for now (for now). When you have selected everything, click the Generate button to Generate the library files.

: Packages \nupengl. Core.\build\native\include
: Packages \nupengl. Core.\build\native\include

After these previous steps, the environment is actually configured
4. Test

#include <glad/glad.h>
#include <GLFW/glfw3.h>

#include <iostream>

void framebuffer_size_callback(GLFWwindow* window, int width, int height);
void processInput(GLFWwindow *window);

// settings
const unsigned int SCR_WIDTH = 800;
const unsigned int SCR_HEIGHT = 600;

int main()
    // glfw: initialize and configure
    // ------------------------------
    glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
    glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);

#ifdef __APPLE__
    glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); // uncomment this statement to fix compilation on OS X

    // glfw window creation
    // --------------------
    GLFWwindow* window = glfwCreateWindow(SCR_WIDTH, SCR_HEIGHT, "LearnOpenGL", NULL, NULL);
    if (window == NULL)
        std::cout << "Failed to create GLFW window" << std::endl;
        return -1;
    glfwSetFramebufferSizeCallback(window, framebuffer_size_callback);

    // glad: load all OpenGL function pointers
    // ---------------------------------------
    if (!gladLoadGLLoader((GLADloadproc)glfwGetProcAddress))
        std::cout << "Failed to initialize GLAD" << std::endl;
        return -1;

    // render loop
    // -----------
    while (!glfwWindowShouldClose(window))
        // input
        // -----

        // render
        // ------
        glClearColor(0.2f, 0.3f, 0.3f, 1.0f);

        // glfw: swap buffers and poll IO events (keys pressed/released, mouse moved etc.)
        // -------------------------------------------------------------------------------

    // glfw: terminate, clearing all previously allocated GLFW resources.
    // ------------------------------------------------------------------
    return 0;

// process all input: query GLFW whether relevant keys are pressed/released this frame and react accordingly
// ---------------------------------------------------------------------------------------------------------
void processInput(GLFWwindow *window)
    if(glfwGetKey(window, GLFW_KEY_ESCAPE) == GLFW_PRESS)
        glfwSetWindowShouldClose(window, true);

// glfw: whenever the window size changed (by OS or user resize) this callback function executes
// ---------------------------------------------------------------------------------------------
void framebuffer_size_callback(GLFWwindow* window, int width, int height)
    // make sure the viewport matches the new window dimensions; note that width and 
    // height will be significantly larger than specified on retina displays.
    glViewport(0, 0, width, height);

If the configuration is successful, a window like

Read More: