mirror of
https://github.com/zoriya/Bomberman.git
synced 2026-06-06 11:12:19 +00:00
headers in seperate folders
This commit is contained in:
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"files.associations": {
|
||||
"*.h": "c",
|
||||
"vector": "cpp"
|
||||
}
|
||||
}
|
||||
@@ -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_ */
|
||||
@@ -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_ */
|
||||
@@ -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_ */
|
||||
@@ -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
@@ -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_ */
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user