separate all utility headers and sources
This commit is contained in:
5
cosets/include/files.hpp
Normal file
5
cosets/include/files.hpp
Normal file
@@ -0,0 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
||||
std::string read_all_text(const std::string &file);
|
||||
19
cosets/include/mesh.hpp
Normal file
19
cosets/include/mesh.hpp
Normal file
@@ -0,0 +1,19 @@
|
||||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "coxeter.hpp"
|
||||
#include "mirrors.hpp"
|
||||
#include "numeric.hpp"
|
||||
|
||||
glm::vec4 identity(const std::vector<glm::vec4> &normals, const std::vector<float> &coords);
|
||||
|
||||
glm::vec4 identity(const Mults &mults, const std::vector<float> &coords);
|
||||
|
||||
glm::vec4 center(const Mults &mults);
|
||||
|
||||
std::vector<glm::vec4> vertices(const Table *t_vert, const glm::vec4 ident);
|
||||
|
||||
std::vector<int> edges(const Table *t_vert);
|
||||
|
||||
std::vector<int> faces(const Table *t_vert);
|
||||
7
cosets/include/mirrors.hpp
Normal file
7
cosets/include/mirrors.hpp
Normal file
@@ -0,0 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
#include <glm/glm.hpp>
|
||||
#include "coxeter.hpp"
|
||||
|
||||
std::vector<glm::vec4> mirror(const Mults &mults);
|
||||
24
cosets/include/numeric.hpp
Normal file
24
cosets/include/numeric.hpp
Normal file
@@ -0,0 +1,24 @@
|
||||
#pragma once
|
||||
|
||||
#include <glm/glm.hpp>
|
||||
#include <vector>
|
||||
#include <algorithm>
|
||||
|
||||
glm::vec4 round(glm::vec4 f, int prec);
|
||||
|
||||
float dot(int n, glm::vec4 a, glm::vec4 b);
|
||||
|
||||
glm::vec4 project(glm::vec4 vec, glm::vec4 target);
|
||||
|
||||
glm::vec4 reflect(glm::vec4 vec, glm::vec4 axis);
|
||||
|
||||
glm::vec4 gram_schmidt_last(std::vector<glm::vec4> vecs);
|
||||
|
||||
glm::vec4 barycentric(std::vector<glm::vec4> basis, std::vector<float> coords);
|
||||
|
||||
std::vector<glm::vec4> plane_intersections(std::vector<glm::vec4> normals);
|
||||
|
||||
|
||||
std::vector<std::vector<int>> combinations(int N, int K);
|
||||
|
||||
std::vector<std::vector<int>> combinations(std::vector<int> N, int K);
|
||||
10
cosets/include/shader.hpp
Normal file
10
cosets/include/shader.hpp
Normal file
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#include <glad/glad.h>
|
||||
#include <string>
|
||||
|
||||
GLint build_shader(GLenum type, const std::string &name, const std::string &src);
|
||||
|
||||
GLint build_shader_file(GLenum type, const std::string &name, const std::string &file);
|
||||
|
||||
GLint build_program(const std::string &name, GLint vs, GLint fs);
|
||||
24
cosets/include/window.hpp
Normal file
24
cosets/include/window.hpp
Normal file
@@ -0,0 +1,24 @@
|
||||
#pragma once
|
||||
|
||||
#include "glad/glad.h"
|
||||
#include <GLFW/glfw3.h>
|
||||
|
||||
class Window {
|
||||
protected:
|
||||
GLFWwindow *_window = nullptr;
|
||||
|
||||
public:
|
||||
virtual void init();
|
||||
|
||||
virtual void update();
|
||||
|
||||
virtual void render();
|
||||
|
||||
virtual void deinit();
|
||||
|
||||
void getBounds(int &width, int &height);
|
||||
|
||||
void swapbuffers();
|
||||
|
||||
void run();
|
||||
};
|
||||
Reference in New Issue
Block a user