Skip to content
/ opengl-seed Public template

βšͺ🌱A modern OpenGL starter repo that you could use to get the ball rolling.

License

Notifications You must be signed in to change notification settings

alaingalvan/opengl-seed

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

11 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Cover Art

βšͺ OpenGL Seed

CMake License

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:

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!

About

βšͺ🌱A modern OpenGL starter repo that you could use to get the ball rolling.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published