2022年7月15日

[Learn OpenGL 筆記] 6. Shaders

6.0 Shaders

 

  • What's shader?
    • Shaders are little programs that rest on the GPU, run for each specific section of the graphics pipeline.

 

6.1 GLSL

 

  • What's GLSL?
    • Shaders are written in the C-like language GLSL.
    • GLSL is tailored for use with graphics and contains useful features specifically targeted at vector and matrix manipulation.

2022年7月8日

[Learn OpenGL 筆記] 4. Hello Window

  • 在專案中,創建一個新的 .cpp 文件,在文件開頭加入下列標頭檔的引用敘述。

 

#include <glad/glad.h>

#include <GLFW/glfw3.h>

 

注意:glad.h 必須在 glfw3.h 之前引用,否則會出現下列錯誤訊息:

OpenGL header already included, remove this include, glad already provides it.

 

2022年7月7日

[Learn OpenGL 筆記] 3. Creating a window

3.1 GLFW

 

  • GLFW 函式庫:支援跟底層作業系統相關的操作,讓 OpenGL 應用程式避免跟特定的作業系統直接打交道,達到跨平台的好處。
  • 可以視為 GLUT 和 FreeGLUT 的升級版。
  • 支援:建立視窗、建立 OpenGL Context、設定視窗的參數、處理使用者的輸入等等。

 

[Windows] Visual Studio: 配置 GLAD

下載 GLAD 庫文件

 

  1. 到 GLAD 官網,參考下列設定進行選擇:
    • Language: C/C++
    • Specification: OpenGL
    • API 中的 gl 版本選擇 Version 3.3 或以上(因爲 3.3 以上的版本是可編程管線)
    • Profile: Core
    • Generate a Loader: 勾選
    • 其餘選項保留不做更動

 

  1. 選擇好之後,點選 GENERATE 生成 GLAD 庫文件,並將網頁所生成的壓縮檔 glad.zip 下載下來。

 

2022年7月6日

[Windows] Visual Studio: 編譯與配置 GLFW

下載與編譯 GLFW 原始碼

 

  1. 到 GLFW 官網,在 Download 頁面點選 Source package 下載原始碼,目前最新釋出的版本為 GLFW 3.3.7。

 

  1. 將下載的壓縮檔解開之後,可以得到一個 glfw-3.3.7 資料夾。

 

  1. 在 glfw-3.3.7 資料夾中,新增一個 build 資料夾。

 

和我聯絡

姓名

電子郵件 *

訊息 *