diff --git a/src/camera.hpp b/src/camera.hpp index 4b4f72f..f348d25 100644 --- a/src/camera.hpp +++ b/src/camera.hpp @@ -4,10 +4,9 @@ #include "transformation.hpp" #include "scene.hpp" -class Camera : - public Transformation +struct Camera : + Transformation { -public: inline Camera(const Scene &scene) : _scene(scene) {} inline void draw() const; diff --git a/src/material.hpp b/src/material.hpp index 8f72063..905e2e1 100644 --- a/src/material.hpp +++ b/src/material.hpp @@ -3,9 +3,8 @@ #include "texture.hpp" -class Material +struct Material { -public: inline void use() const; const Texture *texture; diff --git a/src/mtllib.hpp b/src/mtllib.hpp index ab92ecb..8eb12d5 100644 --- a/src/mtllib.hpp +++ b/src/mtllib.hpp @@ -7,12 +7,11 @@ #include #include -class Mtllib: - public Resource +struct Mtllib: + Resource { RESOURCE(Mtllib) -public: const Material *operator[](const std::string &name) const; private: diff --git a/src/object.hpp b/src/object.hpp index 0696d46..ce72b7b 100644 --- a/src/object.hpp +++ b/src/object.hpp @@ -6,10 +6,9 @@ #include -class Object : - public Transformation +struct Object : + Transformation { -public: Object(const Model &model) : _model(model) {}; void draw(const glm::mat4 &mvp) const; diff --git a/src/program.hpp b/src/program.hpp index c88c034..e523d67 100644 --- a/src/program.hpp +++ b/src/program.hpp @@ -6,12 +6,11 @@ #include -class Program: - public Resource +struct Program: + Resource { RESOURCE(Program) -public: void use() const; GLuint get_uniform_location(const GLchar *name) const; diff --git a/src/resource.hpp b/src/resource.hpp index 6be04c7..c1e1e9a 100644 --- a/src/resource.hpp +++ b/src/resource.hpp @@ -3,17 +3,17 @@ #include "store.hpp" -class Resource +struct Resource { - friend class Store; +private: + friend struct Store; __attribute__((unused)) // Used by friend class Store unsigned long _ref_count = 0; }; #define RESOURCE(T) \ -private: \ - friend class ::Store; \ + friend struct ::Store; \ T(Store &store, const std::string &name); \ static const std::string filename(const std::string &name); diff --git a/src/scene.hpp b/src/scene.hpp index f534d5a..629e1f5 100644 --- a/src/scene.hpp +++ b/src/scene.hpp @@ -7,9 +7,8 @@ #include -class Scene +struct Scene { -public: inline Scene &operator <<(Object *object); inline void draw(const glm::mat4 &mvp) const; diff --git a/src/shader.hpp b/src/shader.hpp index 1784d47..806d77d 100644 --- a/src/shader.hpp +++ b/src/shader.hpp @@ -3,9 +3,8 @@ #include "gl.hpp" -class Shader +struct Shader { -public: Shader(GLenum type, const char *filename); inline GLuint id() const { return _id; }; diff --git a/src/store.hpp b/src/store.hpp index 1fa6a91..ff60c2b 100644 --- a/src/store.hpp +++ b/src/store.hpp @@ -5,11 +5,10 @@ #include #include -class Resource; +struct Resource; -class Store +struct Store { -public: template const T *load(const std::string &name); diff --git a/src/texture.hpp b/src/texture.hpp index c138b71..d7e8cbb 100644 --- a/src/texture.hpp +++ b/src/texture.hpp @@ -6,13 +6,11 @@ #include -class Texture: - public Resource +struct Texture: + Resource { RESOURCE(Texture) -public: - void use() const; private: diff --git a/src/transformation.hpp b/src/transformation.hpp index 680cb9e..ba352e7 100644 --- a/src/transformation.hpp +++ b/src/transformation.hpp @@ -3,9 +3,8 @@ #include -class Transformation +struct Transformation { -public: glm::mat4 transformation() const; glm::mat4 base;