The first day of OpenGL [vs2017 + OpenGL environment configuration]

The OpenGL environment has been configured several times without success.
Today, I finally tried it, so I shared it, so that others can avoid detours.
My tool is VS2017
1. Method (download various library files)
Download the required files for OpenGL
Then you get five files:
Glut.dll Glut.dll Glut.Lib Glut.h
Find the directory.. \VC\Tools\MSVC\14.10.25017\include\gl So let’s put Glut.H in there.

Find the directory.. \VC\Tools\MSVC\14.10.25017\lib\x86 Glut. lib, Glut32.lib

Finally, the
Glut. DLL and glut32.dll go in

C: \ Windows \ system32 folder (32-bit system) or ‪ C: \ Windows \ SysWOW64 (64 – bit systems).

2. Methods (using VS plug-ins)
Open VS and create a C++ project (Win32 Console – Blank Project)
Then click Project – Manage the NuGet package
Then click Browse – type Nupengl in the search bar
Then install (two if you have two)
One final test:

The view plain



    # include & lt; GL/glut.h> Void the Show () {glClear (GL_COLOR_BUFFER_BIT); GlRectf (0.5-0.1 f to 0.1 f, f, 0.5 f); GlFlush (); } int main (int arg c, char * argv []) {glutInit (& amp; Arg c, argv); GlutInitDisplayMode (GLUT_RGB | GLUT_SINGLE); GlutInitWindowPosition (100, 100); GlutInitWindowSize (400, 400); OpenGL glutCreateWindow (” “); GlutDisplayFunc (Show); GlutMainLoop (); Return 0; }

    Run it and you’ll see a white square

    If there are no errors, the configuration is successful!
    (if you try and succeed, remember thumb up ah )

Read More: