headers in seperate folders

This commit is contained in:
arthur.jamet
2021-05-14 10:29:12 +02:00
parent 34b7fd5410
commit 8474fcc2ac
10 changed files with 116 additions and 2 deletions
+6
View File
@@ -0,0 +1,6 @@
{
"files.associations": {
"*.h": "c",
"vector": "cpp"
}
}
+21
View File
@@ -0,0 +1,21 @@
/*
** EPITECH PROJECT, 2021
** Bomberman
** File description:
** Pixel
*/
#ifndef PIXEL_HPP_
#define PIXEL_HPP_
#include <raylib.h>
#include "Drawables/Drawable.hpp"
namespace Ray {
struct Circle: public Drawable
{
int radius;
};
};
#endif /* !PIXEL_HPP_ */
+21
View File
@@ -0,0 +1,21 @@
/*
** EPITECH PROJECT, 2021
** Bomberman
** File description:
** Pixel
*/
#ifndef PIXEL_HPP_
#define PIXEL_HPP_
#include <raylib.h>
#include "Drawables/Drawable.hpp"
namespace Ray {
struct Line: public Drawable
{
Vector2 dimensions;
};
};
#endif /* !PIXEL_HPP_ */
+21
View File
@@ -0,0 +1,21 @@
/*
** EPITECH PROJECT, 2021
** Bomberman
** File description:
** Pixel
*/
#ifndef PIXEL_HPP_
#define PIXEL_HPP_
#include <raylib.h>
#include "Drawables/Drawable.hpp"
namespace Ray {
struct Point: public Drawable
{
};
};
#endif /* !PIXEL_HPP_ */
+26
View File
@@ -0,0 +1,26 @@
/*
** EPITECH PROJECT, 2021
** Bomberman
** File description:
** Drawable
*/
#ifndef DRAWABLE_HPP_
#define DRAWABLE_HPP_
#include <raylib.h>
#include <Vector.hpp>
namespace Ray {
struct Drawable
{
//top-left position
Vector2 position;
Color color;
virtual ~Drawable() = 0;
};
};
#endif /* !DRAWABLE_HPP_ */
+3 -2
View File
@@ -11,8 +11,9 @@
#include <raylib.h>
namespace Ray {
typedef Vector2 Vector2;
typedef Vector3 Vector3;
typedef ::Vector2 Vector2;
typedef ::Vector3 Vector3;
typedef ::Vector4 Vector4;
}
#endif /* !VECTOR_HPP_ */
+18
View File
@@ -11,6 +11,7 @@
#include <raylib.h>
#include <string>
#include "Vector.hpp"
#include "Keyboard.hpp"
namespace Ray {
class Window {
@@ -27,6 +28,9 @@ class Window {
// Check if KEY_ESCAPE pressed or Close icon pressed
bool shouldClose(void) const;
//Set key used to close window (default: ESC)
void setExitKey(Keyboard::Key key);
// Close window and unload OpenGL context
bool close(void);
@@ -48,6 +52,20 @@ class Window {
// Check if cursor is on the current screen.
bool cursorIsOnScreen(void) const;
// Set target FPS (maximum)
void setFPS(int fps);
// Set background color (framebuffer clear color)
void clear(const Color &color);
// Setup canvas (framebuffer) to start drawing
// Must be called before first draw of iteration
void beginDrawing(void);
// End canvas drawing and swap buffers (double buffering)
// Must be called after last draw of iteration
void endDrawing(void);
private:
Ray::Vector2 _dimensions;
std::string _title;