benwinding / open-gl-terrain-example

A little OpenGL demo in c++

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

open-gl-terrain-example

This is a little OpenGL demo project, written in C++ years ago (my original code), and updated to work on Apple Silicon too!

out.mp4

Some artifacts of the terrain on the mac version

Features:

  • First Person View (walk around with arrow keys)
  • Particle simulation Fire/Water (physics has left the chat)
  • Procedurally generated terrain and trees
  • Environment sky box
  • Height mapping
  • Sound (just launches in another window)

Dependencies

This project has the following dependencies:

  • C++ Libraries:
    • OpenGL (compatible with Mac Silicon)
    • GLFW
    • GLEW
  • Build System
    • Make
    • Clang

Build - Linux

Make sure you have installed the relevant apt libs:

sudo apt install libglfw3-dev libglew-dev libglm-dev clang
# Then build with
make 

Build - Mac (silicon)

Make sure you have installed the relevant brew libs:

brew install glfw --build-from-source # You might not need --build-from-source but I did
brew install glew glm clang
# Then build with
make

Running it

It should build an executable that you can just run with:

./demo

Why?

This was an old OpenGl UNI assignment from years ago that was fun to make!

I wanted to get it running on a new Apple Silicon Macbook, but it turned out to be really hard đź’€ So I thought I'd share this example, in case anyone else is wondering how to get OpenGl running on Mac Silicon M1/M2/M3 processors...

About

A little OpenGL demo in c++

License:MIT License


Languages

Language:C 58.5%Language:C++ 38.6%Language:GLSL 2.4%Language:Makefile 0.3%Language:Shell 0.1%