opengl-seed
opengl-seed copied to clipboard
βͺπ±A modern OpenGL starter repo that you could use to get the ball rolling.
βͺ OpenGL Seed
A starter repo that you could use to build an OpenGL application on top of.
Check out the this blog post for more details about this example.
Setup
First install:
-
An IDE such as Visual Studio, XCode, or a compiler such as GCC.
Then type the following in your terminal.
# π Clone the repo
git clone https://github.com/alaingalvan/opengl-seed --recurse-submodules
# πΏ go inside the folder
cd opengl-seed
# π― If you forget to `recurse-submodules` you can always run:
git submodule update --init
# π· Make a build folder
mkdir build
cd build
# πΌοΈ To build your Visual Studio solution on Windows x64
cmake .. -A x64
# π To build your XCode project on Mac OS
cmake .. -G Xcode
# π§ To build your .make file on Linux
cmake ..
# π¨ Build on any platform:
cmake --build .
WebAssembly
Note: if you're on Windows, I would highly recommend using the Windows Subsystem for Linux.
First, install the latest version of Emscripten via the Emscripten SDK. Make sure to add it's Emscripten installation to your PATH
, then:
# β οΈ Possible dependencies you might need:
sudo apt-get update
sudo apt-get install cmake build-essential llvm
# π· Make a build folder
mkdir wasm
cd wasm
# π¨ Build the project
emcmake cmake ..
emmake make OpenGLSeed -j
From there create an HTML file that loads the generated OpenGLSeed.js
file, and run an http server. You can find an example of this here.
File Structure
ββ π external/ # πΆ Dependencies
β ββ π crosswindow/ # πΌοΈ OS Windows
β ββ π crosswindow-graphics/ # π¨ GL Context Creation
β ββ π glm/ # β Linear Algebra
β ββ π opengl-registry/ # π GL Headers
β ββ π glad/ # π GL Extension Loader
ββ π src/ # π Source Files
β ββ π Utils.h # βοΈ Utilities (Load Files, Check Shaders, etc.)
β ββ π Triangle.h # πΊ Triangle Draw Code
β ββ π Triangle.cpp # -
β ββ π Main.cpp # π Application Main
ββ π .gitignore # ποΈ Ignore certain files in git repo
ββ π CMakeLists.txt # π¨ Build Script
ββ π license.md # βοΈ Your License (Unlicense)
ββ πreadme.md # π Read Me!