This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <marl/defer.h> | |
#include <marl/event.h> | |
#include <marl/scheduler.h> | |
#include <marl/waitgroup.h> | |
#include <algorithm> | |
#include <charconv> | |
#include <fstream> | |
#include <iostream> | |
#include <map> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <as/as-math-ops.hpp> // https://github.com/pr0g/as | |
struct Camera | |
{ | |
as::vec3 pivot = as::vec3::zero(); // pivot point to rotate about | |
as::vec3 offset = as::vec3::zero(); // offset relative to pivot | |
float yaw = 0.0f; // yaw rotation in radians | |
float pitch = 0.0f; // pitch rotation in radians | |
// view camera transform (v in MVP) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 3.15) | |
project(constexpr LANGUAGES CXX) | |
add_executable(${PROJECT_NAME}) | |
target_sources(${PROJECT_NAME} PRIVATE main.cpp) | |
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Derived from this Gist by Richard Gale: | |
// https://gist.github.com/RichardGale/6e2b74bc42b3005e08397236e4be0fd0 | |
// ImGui BFFX binding | |
// In this binding, ImTextureID is used to store an OpenGL 'GLuint' texture | |
// identifier. Read the FAQ about ImTextureID in imgui.cpp. | |
// You can copy and use unmodified imgui_impl_* files in your project. See | |
// main.cpp for an example of using this. If you use this binding you'll need to | |
// call 4 functions: ImGui_ImplXXXX_Init(), ImGui_ImplXXXX_NewFrame(), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::collections::HashMap; | |
use std::fs; | |
#[derive(Debug)] | |
struct Quantity { | |
element: String, | |
count: i64, | |
} | |
#[derive(Debug)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// glm | |
struct Camera | |
{ | |
glm::vec3 position { 0.0f }; | |
float yaw { 0.0f }; | |
float pitch { 0.0f }; | |
// pass this to the shader (the 'v' in the mvp multiplication) | |
glm::mat4 view() const | |
{ |