60 lines
1.2 KiB
C++
60 lines
1.2 KiB
C++
#ifndef Box_h_
|
|
#define Box_h_
|
|
|
|
#include <iostream>
|
|
|
|
#include <SDL.h>
|
|
|
|
#define GLM_ENABLE_EXPERIMENTAL
|
|
#include "glm/common.hpp"
|
|
#include "glm/vec2.hpp"
|
|
|
|
struct Box
|
|
{
|
|
SDL_FRect rect = {0, 0, 0, 0};
|
|
|
|
Box(glm::vec2 = {0, 0}, glm::vec2 = {0, 0});
|
|
float get_x();
|
|
float get_y();
|
|
float get_w();
|
|
float get_h();
|
|
void set_x(float);
|
|
void set_y(float);
|
|
void set_w(float);
|
|
void set_h(float);
|
|
glm::vec2 get_size();
|
|
void set_size(glm::vec2);
|
|
float get_top();
|
|
float get_right();
|
|
float get_bottom();
|
|
float get_left();
|
|
void set_top(float);
|
|
void set_right(float);
|
|
void set_bottom(float);
|
|
void set_left(float);
|
|
glm::vec2 get_nw();
|
|
glm::vec2 get_north();
|
|
glm::vec2 get_east();
|
|
glm::vec2 get_south();
|
|
glm::vec2 get_west();
|
|
glm::vec2 get_center();
|
|
void set_nw(glm::vec2);
|
|
void set_north(glm::vec2);
|
|
void set_east(glm::vec2);
|
|
void set_south(glm::vec2);
|
|
void set_west(glm::vec2);
|
|
void set_center(glm::vec2);
|
|
SDL_FRect* get_rect();
|
|
void zero();
|
|
void move(glm::vec2);
|
|
std::string get_class_name() { return "Box"; }
|
|
std::ostream& to_string (std::ostream&) const;
|
|
|
|
};
|
|
|
|
std::ostream& operator<< (std::ostream&, const Box&);
|
|
|
|
#include "extension.hpp"
|
|
|
|
#endif
|