Skip to content

Theodor908/Graphic-Processing-Systems

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

👾 opengl-imgui-cmake-template

A quick and easy way to get started using OpenGL 3.3 Core Profile together with imgui in a CMake environment.

This template only contains a wrapper class for shaders, and one for the window with appropriate Initialize/LoadContent/Update/Render as a game loop.

The shader class allows for hot-reloading of the fragment shader, so whenever you modify the testing.fs file in the build/resources/shaders/ directory, the shader will automagically be reloaded!

NOTE: The shader files in resources/shaders/ are copied into the build/ directory upon build, so if you want to save your hot-reloaded changes, then you must also modify the shaders in resources/shaders/ directory.

Screenshots

Skybox

Skybox

Street

Street

Lighting

Lighting

Collisions

Collisions

Random and AI Cars

Random and AI Cars

Experimental

These were built in a separate experimental repo and are not part of the main scene system.

Raytracing

Raytracing

Still working through some issues with this one — not fully functional yet.

Blackhole

Blackhole

Fully functional. The gravitational lensing effect is my favourite part of this one.

Getting started

  1. Create a new repo by clicking Use this template up to the right!
  2. Download some GLFW pre-compiled binaries and put the libglfw3.a file in libs/glfw/.
  3. Compile with CMake and then run it! Piece of cake!

Building

Requires CMake 3.10+ and a C++20 compiler. Tested with MSYS2 MinGW64.

mkdir build && cd build
cmake .. -G "Ninja"
cmake --build .

Or with Make:

mkdir build && cd build
cmake .. -G "MinGW Makefiles"
mingw32-make

Running

From the build directory:

./opengl-imgui-cmake-template.exe

The executable expects resources/ (shaders + textures) next to it — CMake copies this folder into the build directory automatically.

Controls

Key Action
W / S Accelerate / Brake (in car scenes)
A / D Steer left / right
Mouse Look around (free camera scenes)
Tab bar Switch between scenes

Remarks

  • Uses imgui version 1.83
  • Has only been tested on MingW64 compiler for Windows (so it may require some fixing for it to work for gcc or clang)

About

OpenGL 3.3 graphics engine with multiple 3D scenes, lighting, shadows, terrain, and a driveable car.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages