Writing an OpenGL renderer based on the OpenGL tutorial series by The Cherno (https://www.youtube.com/playlist?list=PLlrATfBNZ98foTJPJ_Ev03o2oq3-GGOS2)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
nek0 102ff2ec77 finished episode 31 3 months ago
res finished episode 30. Episodes in between were either theory or trivial. 3 months ago
src finished episode 31 3 months ago
.gitignore get actual triangle on screen 6 months ago
CHANGELOG.md init 6 months ago
LICENSE init 6 months ago
README.md finished episode 31 3 months ago
Setup.hs init 6 months ago
renderer-tutorial.cabal finished episode 31 3 months ago
shell.nix finished episode 31 3 months ago

README.md

renderer-tutorial

This softwre aims to be an OpenGL renderer written in Haskell following the OpenGL tutorial by The Cherno (https://www.youtube.com/playlist?list=PLlrATfBNZ98foTJPJ_Ev03o2oq3-GGOS2).

Important notes

There are some major deviations from the tutorial setup here as follows:

  • Code base is entirely written in Haskell, not C++
  • Instead of GLFW with GLEW I use SDL2 out of familiarity
  • Shaders are actually split into files per type, since I’mn ot willing to unleash Haskell list magic
  • Since I am using the OpenGL core profile from the start there is also a vertex array creation call present from the start.
  • I don’t have not found a suitable GUI library, so all things interactive are done through input events.

I leave as many helpful comments as possible throughout the code, so feel free to peruse it.

Mapped input events

Keyboard

To switch to a scene, press one of the buttons below, To return to the Menu, press Escape.

F1 - Colour changer

Use the keys 1 through 4 to increase the values of R, G, B or A of the background colour. Press Left Shift and the number key to decrease it.

F2 - Textured quads

Use keys 1 and 2 to switch between the textured quads, move them forward on the x and y axis by pressing X and Y respectively or backward using Left Shift and the appropriate key.

F3 - Textured quads batched statically

Move the quads forward on the x and y axis by pressing X and Y respectively or backward using Left Shift and the appropriate key.

F4 - Textured quads batched dynamically

No interaction.