• Stars
    star
    114
  • Rank 308,031 (Top 7 %)
  • Language
    C
  • Created over 4 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Examples from learnopengl.com, implemented using Sokol libraries.

LearnOpenGl Examples

Unofficial cross platform examples for learnopengl.com

Live Demos

  • written in C.
  • shader dialect GLSL v450
  • runs on OSX, Linux, Windows and web (emscripten) from the same source
  • uses Sokol libraries for cross platform support

Building

Fips is used as build system to support multiple platforms.

Requirements

  • a C development environment:
    • OSX: Xcode + command line tools
    • Linux: make/ninja + gcc/clang
    • Windows: Visual Studio
  • CMake
  • Python
  • Git
  • Linux only: libgl-dev libx11-dev libxi-dev libxcursor-dev

How to Build

> mkdir fips-workspace
> cd fips-workspace
> git clone https://github.com/GeertArien/learnopengl-examples.git
> cd learnopengl-examples
> ./fips build
> ./fips run 1-3-1-rendering

Targets

To get a list of targets:

> ./fips list targets

To run a specific target:

> ./fips run 3-1-2-backpack-lights

Web Builds

To enable web builds you need to setup the emscripten SDK and select one of the webgl2 configs: webgl2-wasm-ninja-debug or webgl2-wasm-ninja-release.

> ./fips setup emscripten
> ./fips set config webgl2-wasm-ninja-debug
> ./fips build

IDE Integration

Fips supports CLion, Visual Studio, Visual Studio Code and XCode as provided by cmake:

> ./fips set config linux-clion-debug
> ./fips gen
> ./fips open
> ./fips set config win64-vstudio-debug
> ./fips gen
> ./fips open
> ./fips set config win64-vscode-debug
> ./fips gen
> ./fips open
> ./fips set config osx-xcode-debug
> ./fips gen
> ./fips open