# LabA01 Hello OpenGL

<figure><img src="https://3464970502-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3JUKGJZ67JX02QZdPhsy%2Fuploads%2FdUVfNBXxcaLJGLDt04lK%2Fimage.png?alt=media&#x26;token=0433f32a-7745-4304-9df6-630f4b5d607d" alt="" width="483"><figcaption></figcaption></figure>

## Key skills to learn

Set up OpenGL programming environment with GLFW, GLAD

Confgure CMake for cross-platform building

Draw triangles using vertex buffer objects (VBO)

\[optional] Use Git with Visual Studio Code or Visual Studio

## Tasks

0.a \[Optional] Setting up an OpenGL framework with GLFW, GLAD

0.b \[Optional] Conifgure CMake

1.1 Creating an OpenGL window

1.2 Draw a single triangle

1.3 \[Optional] Commit code to and checkout code from Github

**Important Note: To save time in class, you can skip task 0.a and 0.b by starting with the scaffold project proj01\_scaffold.zip below or from the lab download folder on Blackboard. Download and open the project with VS code or Visual Studio 2022.**

{% file src="<https://3464970502-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3JUKGJZ67JX02QZdPhsy%2Fuploads%2Ft7ZI2FeuX38qtJJKcmss%2Fproj01_scaffold.zip?alt=media&token=cc239147-02e4-4e5a-a87b-cf6ab45025d7>" %}

## Project profile

Language: C++

Build system : CMake/Visual Studio Code/Visual Studio 2022

External libaries: GLFW, GLAD

Platform: Windows

## External libraries

GLAD: OpenGL function loader

GLFW: for OpenGL window management and input events handling

## Tools

Visual Studio Code + CMake Tools extension : IDE (git integrated)

Visual Studio 2022 : IDE (git integrated)

CMake: for cross platform building file generation&#x20;

Git : for version control

## Source code

### **Scaffold with OpenGL and CMake ready**

{% file src="<https://3464970502-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3JUKGJZ67JX02QZdPhsy%2Fuploads%2Ft7ZI2FeuX38qtJJKcmss%2Fproj01_scaffold.zip?alt=media&token=cc239147-02e4-4e5a-a87b-cf6ab45025d7>" %}

### Final source code

{% embed url="<https://github.com/zhaoyoubing/proj01>" %}
