OpenGL Learning Path (0)--Installation

Source: Internet
Author: User
Tags win32 window

The purpose of this experiment: Install and configure the environment.

1 Downloads

https://www.opengl.org/

Https://www.opengl.org/wiki/Getting_Started#Downloading_OpenGL

Find the https://www.opengl.org/sdk/libs/in the SDK

Glus download, unzip will get a file

2 installation

I'm using Ms Studio 2015.

This is the installation directory for my MS Studio: C:\Program Files (x86) \microsoft Visual Studio 14.0

First, put the Glut.lib and glut32.lib files in C:\Program files (x86) \microsoft Visual Studio 14.0\lib

Then, create the GL directory under the C:\Program files (x86) \microsoft Visual Studio 14.0\vc\include file, and put the glut.h

As follows:

As for DLL files, of course, it should be placed in the USystem32 directory:

At this point, the environment is set up successfully, create Win32 for console in MS, write this test code in Mian.cpp:

Operation Result:

Well, the success of the operation shows that our environment has been built successfully.

Learn to be faith; Know it, and then know the reason why the attitude, so it is necessary to talk about DLL, lib file and glut what is a ...

Glut is not necessary for OpenGL, but it will bring some convenience to our study. The GL Library in OpenGL is the core library, Glu is a utility library, glut is a utility library, GL is the core, Glu is part of the package for GL, glut is OpenGL's cross-platform tool Library, GL contains the most basic 3D functions, and Glu seems to support GL, if the arithmetic is good, The same effect can be done without the glu of the case. Glut is the basic window interface, is independent of GL and Glu, if you do not like to use glut can use MFC and Win32 window, etc., but glut is cross-platform, which ensures that our programming is cross-platform, if the use of MFC or WIN32 can only be used on Windows operating systems. One of the big reasons for choosing OpenGL is that it's cross-platform, so we can use the glut library as much as possible.

DLL file:

DLL The dynamic link library file is a DLL file, also known as an "application extension", which is a software file type. In Windows, many applications are not a complete executable, and they are split into relatively independent, dynamic- link Libraries , DLL files, placed in the system. When we execute a program, the corresponding DLL file is called.

Lib

Lib has two, one is a static library, such as the C-runtime library, this Lib has the function of the implementation code, generally used in static, it is the LIB code into the target module (EXE or DLL) file, so after the link, lib file is useless. A lib is used with the DLL, there is no code, code in the DLL, this lib is used in the static call DLL, so the role is linked to the role, Link completed, Lib is useless. As for the dynamic call DLL, the Lib file is not used at all. After the target module (EXE or DLL) file is generated, LIB files are not desired.

OpenGL Learning Path (0)--Installation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.