Skip to content

Commit

Permalink
fix: add correct .hpp files
Browse files Browse the repository at this point in the history
  • Loading branch information
diogogmatos committed Mar 3, 2024
1 parent ae699ad commit 6a13c76
Show file tree
Hide file tree
Showing 8 changed files with 101 additions and 61 deletions.
21 changes: 21 additions & 0 deletions engine/include/Camera.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#ifndef CAMERA_HPP
#define CAMERA_HPP

#include "Camera.hpp"
#include "utils.hpp"

class Camera {
public:
Point position;
Point lookAt;
Point up;
int fov;
float near;
float far;

Camera();
Camera(Point position, Point lookAt, Point up, int fov, float near,
float far);
};

#endif // CAMERA_HPP
19 changes: 19 additions & 0 deletions engine/include/Configuration.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#ifndef CONFIGURATION_HPP
#define CONFIGURATION_HPP

#include <vector>

#include "Camera.hpp"
#include "Configuration.hpp"
#include "Window.hpp"

class Configuration {
public:
Window window;
Camera camera;
std::vector<char*> models;

Configuration(Window window, Camera camera, std::vector<char*> models);
};

#endif // CONFIGURATION_HPP
15 changes: 15 additions & 0 deletions engine/include/Window.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#ifndef WINDOW_HPP
#define WINDOW_HPP

#include "Window.hpp"

class Window {
public:
float width;
float height;

Window();
Window(float width, float height);
};

#endif // WINDOW_HPP
10 changes: 10 additions & 0 deletions engine/include/parse.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#ifndef PARSE_HPP
#define PARSE_HPP

#include "../../lib/rapidxml-1.13/rapidxml.hpp"
#include "Configuration.hpp"
#include "parse.hpp"

Configuration parseConfig(char* filename);

#endif // PARSE_HPP
46 changes: 18 additions & 28 deletions engine/src/Camera.cpp
Original file line number Diff line number Diff line change
@@ -1,30 +1,20 @@
#include "utils.hpp"
#include "Camera.hpp"

class Camera {
public:
Point position;
Point lookAt;
Point up;
int fov;
float near;
float far;
Camera::Camera() {
this->position = Point();
this->lookAt = Point();
this->up = Point();
this->fov = 0;
this->near = 0;
this->far = 0;
}

Camera() {
this->position = Point();
this->lookAt = Point();
this->up = Point();
this->fov = 0;
this->near = 0;
this->far = 0;
}

Camera(Point position, Point lookAt, Point up, int fov, float near,
float far) {
this->position = position;
this->lookAt = lookAt;
this->up = up;
this->fov = fov;
this->near = near;
this->far = far;
}
};
Camera::Camera(Point position, Point lookAt, Point up, int fov, float near,
float far) {
this->position = position;
this->lookAt = lookAt;
this->up = up;
this->fov = fov;
this->near = near;
this->far = far;
}
21 changes: 7 additions & 14 deletions engine/src/Configuration.cpp
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
#include "Camera.cpp"
#include "Window.cpp"
#include "Configuration.hpp"

class Configuration {
public:
Window window;
Camera camera;
std::vector<char*> models;

Configuration(Window window, Camera camera, std::vector<char*> models) {
this->window = window;
this->camera = camera;
this->models = models;
}
};
Configuration::Configuration(Window window, Camera camera,
std::vector<char*> models) {
this->window = window;
this->camera = camera;
this->models = models;
}
22 changes: 9 additions & 13 deletions engine/src/Window.cpp
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
class Window {
public:
float width;
float height;
#include "Window.hpp"

Window() {
this->width = 0;
this->height = 0;
}
Window::Window() {
this->width = 0;
this->height = 0;
}

Window(float width, float height) {
this->width = width;
this->height = height;
}
};
Window::Window(float width, float height) {
this->width = width;
this->height = height;
}
8 changes: 2 additions & 6 deletions engine/src/parse.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
#include "parse.hpp"

#include <fstream>
#include <iostream>

#include "../../lib/rapidxml-1.13/rapidxml.hpp"
#include "Camera.cpp"
#include "Configuration.cpp"
#include "Window.cpp"
#include "utils.hpp"

Configuration parseConfig(char* filename) {
// open file in read mode
std::fstream file;
Expand Down

0 comments on commit 6a13c76

Please sign in to comment.