separate all utility headers and sources

This commit is contained in:
2019-09-17 00:04:02 -04:00
parent 8cb5dd87ad
commit cd2cbf85d0
15 changed files with 162 additions and 98 deletions

5
cosets/include/files.hpp Normal file
View 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
View 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);

View File

@@ -0,0 +1,7 @@
#pragma once
#include <vector>
#include <glm/glm.hpp>
#include "coxeter.hpp"
std::vector<glm::vec4> mirror(const Mults &mults);

View 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
View 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
View 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();
};