GLFW 3.3.8
create a project on Windows
# open vscode 2022 > create new project > Empty Project C++
# setup project name "maison"
# CMake 3.26.4 GUI
# source: glfw-3.3.8
# build binaries: glfw-3.3.8/build
# click configure > generator select "Visual Studio 17 2022" & use default native compilers > finish
Selecting Windows SDK version 10.0.22000.0 to target Windows 10.0.22621.
The C compiler identification is MSVC 19.36.32537.0
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.36.32532/bin/Hostx64/x64/cl.exe - skipped
Detecting C compile features
Detecting C compile features - done
Performing Test CMAKE_HAVE_LIBC_PTHREAD
Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
Looking for pthread_create in pthreads
Looking for pthread_create in pthreads - not found
Looking for pthread_create in pthread
Looking for pthread_create in pthread - not found
Found Threads: TRUE
Found Doxygen: C:/mingw64/bin/doxygen.exe (found version "1.9.7") found components: doxygen
Using Win32 for window creation
Configuring done (4.5s)
# click configure again
# click generate
# close cmake GUI
# open glfw-3.3.8/build/GLFW.sln in vscode
# right click Solution 'GLFW' > Build Solution
cp glfw-3.3.8/build/src/Debug/glfw3.lib maison/lib/glfw3.lib
cp -r glfw-3.3.38/include/GLFW maison/include/GLFW/
# go to https://glad.dav1d.de/ > gl Version 3.3 > generate > glad.zip
cp -r glad.zip/include/glad maison/include/glad/
cp -r glad.zip/include/KHR maison/include/KHR/
cp glad.zip/src/glad.c maison/glad.c
# open maison/maison.sln with vscode 2022
# at vscode maison right click select properties > maison Property Pages > select "All Platforms"
# Configuration Properties > VC++ Directories
# Include Directories > maison/include
# Library Directories > maison/lib
# Configuration Properties > Linker > Input > Additonal Dependencies add following
glfw3.lib
opengl32.lib
# drag glad.c from File Explorer to vscode 2022 maison>Source Fiels folder
# at vscode 2022 maison > Source Files > right click > add > new item > main.cpp > paste the following code > then Run Local Windows Debugger
#include <iostream>
#include <glad/glad.h>
#include <GLFW/glfw3.h>
int main()
{
return 0;
}
Graphic Pipelines of OpenGL
| The graphics pipeline takes as input a set of 3D coordinates and transforms these to colored 2D pixels on your screen. The graphics pipeline can be divided into several steps where each step requires the output of the previous step as its input. All of these steps are highly specialized (they have one specific function) and can easily be executed in parallel. Because of their parallel nature, graphics cards of today have thousands of small processing cores to quickly process your data within the graphics pipeline. The processing cores run small programs on the GPU for each step of the pipeline. These small programs are called shaders
. Shaders are written in the OpenGL Shading Language (GLSL). Note that the blue sections represent sections where we can inject our own shaders.
Application Stage: This is where developers create and prepare the data that needs to be rendered.
Geometry Stage: Vertex data is passed to this stage where it is transformed, lighting is computed and finally projected onto the screen coordinate system.
Rasterization Stage: This stage takes the resulting coordinate data from the geometry stage and converts it into a pattern of pixels that will be displayed on the screen.
Fragment Stage: Here, individual pixels are processed, including texturing, shading, blending, and other effects.
Display Stage: This final stage is where the processed data is sent to the display device for output to the screen.
Exercises
Page Source