win10+VS2017+OpenGL ES3.0 environment configuration source code compilation and sample operation

@ win10+VS2017+OpenGL ES3.0 environment configuration source code compilation and example operation

win10+VS2017+OpenGL ES3.0 environment configuration source code compilation and sample operation

I refer to other people's blog content to learn the opengles3.0 programming guide, and use VS2017 to perform the actual environment configuration and source code compilation of OpenGL ES3.0 on the win10 system.

1. Environmental preparation

1 Download and install Visual Studio 2017

2 Download the source code of "opengles3.0 Programming Guide"

https://github.com/danginsburg/opengles3-book

3 Download the CMake compilation tool

4 Download the mail opengl es emulator to run the opengl program, it is recommended to download the 32-bit zip package

https://developer.arm.com/downloads/-/opengl-es-emulator-downloads

All downloaded files are shown in the image below:
insert image description here

2. Environment configuration

1 Unzip the compressed package of the mail opengl es simulator

My decompression path F:\opengles3.0\Mali_OpenGL_ES_Emulator-v3.0.2.g694a9-Windows-32bit

2 Open the path under the installation directory of your own Visual Studio 2017

My installation path is D:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.16.27023

3 include, lib and dll file copy

Copy the following files under the Mali_OpenGL_ES_Emulator-v3.0.2.g694a9-Windows-32bit folder:

(1) Copy all the files in the include to the include of Visual Studio 2017.

(2) Copy the three files libEGL.lib, libGLESv2.lib, libMaliEmulator.lib to lib/x86 of Visual Studio.

(3) Copy libEGL.dll, libGLESv2.dll, libMaliEmulator.dll to bin/Hostx86/x86 of Visual Studio.

3. Opengles3.0 programming guide source code compilation

1 Create a folder opengles3_build86 in the same directory to save the compiled files

2 Open the installed cmake-gui file

F:\opengles3.0\cmake-3.15.6-win64-x64\bin

(1) The source code path is opengles3-book-master

本人路径 F:\opengles3.0\opengles3-book-master

(2) The build thr binaries path is the opengles3_build86 directory created in step 1

(3) Click Configure on the lower left and select Visual Studio 15 2017 win32 version
insert image description here

(4) After clicking finish, an error red box will appear, and the following operations can be performed

Modify the environment configuration of EGL_LIBRARY, which is the full path of libEGL.lib:

本人路径为:D:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.16.27023\lib\x86\libEGL.lib

Modify the OPENGLES_LIBRARY environment configuration, which is the full path of libGLESv2.lib:

本人路径为:D:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.16.27023\lib\x86\libGLESv2.lib

(5) Click configure again, if no error is reported, click Generate. If the following prompt appears, the compilation is successful.
insert image description here

Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.22621.
Configuring done
Generating done

3 Open the ES3_Book.sln file under the opengles3_build86/ folder with VS2017
insert image description here

Right-click on Hello_Triangle and set it as a startup project. Release mode, 32 is the environment.

Right-click Hello_Triangle, regenerate, and run it directly to display the drawn triangle
insert image description here

4. Create a project by yourself

Create an opengl_es3.0 folder on the D drive (I use the D drive on my computer) to store include files, lib library files, bin files, etc.
insert image description here

1 include file copy

将F:\opengles3.0\opengles3-book-master\中的Common和Externa两个文件夹拷贝到D:\opengl_es3.0\中。

2 Create bin and lib folders in D:\opengl_es3.0\

3 lib file copy

(a) 将F:\opengles3.0\Mali_OpenGL_ES_Emulator-v3.0.2.g694a9-Windows-32bit\中的 libEGL.lib、libGLESv2.lib、libMaliEmulator.lib 拷贝到D:\opengl_es3.0\lib\中。
(b) 将F:\opengles3.0\opengles3_build86\Common\Release中Common.lib 同样拷贝到D:\opengl_es3.0\lib\中。

insert image description here

4 bin file copy

(a)将F:\opengles3.0\Mali_OpenGL_ES_Emulator-v3.0.2.g694a9-Windows-32bit\中的 libEGL.dll、libGLESv2.dll、libMaliEmulator.dll、log4cplus.dll 拷贝到D:\opengl_es3.0\bin\中。
(b)将F:\opengles3.0\Mali_OpenGL_ES_Emulator-v3.0.2.g694a9-Windows-32bit\openglessl 拷贝到D:\opengl_es3.0\bin\中。

insert image description here

5 Advanced System Settings

Open the computer's system properties—>Advanced—>Environment Variables—>System Variables—>Path—>Edit—>New and
fill D:\opengl_es3.0\bin into the new column.
insert image description here

6 Create a new project with vs2017

Add the Hello_Triangle.c file to your own project.

(a) Set the include path

Add the following two paths to Properties—>VC++ Directories—>Included Directories

D:\opengl_es3.0\Common\include     
D:\opengl_es3.0\External\include

insert image description here

(b) Set the lib path

Add the following path to Properties—>VC++ Directories—>Library Directories

D:\opengl_es3.0\lib

insert image description here

(c) Additional item settings

will be as follows

libEGL.lib
libGLESv2.lib
libMaliEmulator.lib
Common.lib
kernel32.lib
user32.lib
gdi32.lib
winspool.lib
shell32.lib
ole32.lib
oleaut32.lib
uuid.lib
comdlg32.lib
advapi32.lib

Add it to Linker -> Input -> Additional Dependencies.

Run this code to display the effect of drawing a triangle.

5. References

1 windows configuration opengles3.0 development environment:

https://blog.csdn.net/mmy545237835/article/details/80762150

2 Windows10 builds OpenGL ES 3.0 development environment

https://blog.csdn.net/lxk_1993/article/details/88921872

Guess you like

Origin blog.csdn.net/beijingmake209/article/details/128367315