879941355d
A point is a 2D vector. A position represent a point relative to the screen size.
26 lines
492 B
C
26 lines
492 B
C
#ifndef COMMON_H
|
|
#define COMMON_H
|
|
|
|
#include <SDL2/SDL_stdinc.h>
|
|
|
|
#define MIN(X,Y) (X) < (Y) ? (X) : (Y)
|
|
#define MAX(X,Y) (X) > (Y) ? (X) : (Y)
|
|
|
|
struct size {
|
|
Uint16 width;
|
|
Uint16 height;
|
|
};
|
|
|
|
struct point {
|
|
Uint16 x;
|
|
Uint16 y;
|
|
};
|
|
|
|
struct position {
|
|
// The video screen size may be different from the real device screen size,
|
|
// so store to which size the absolute position apply, to scale it accordingly.
|
|
struct size screen_size;
|
|
struct point point;
|
|
};
|
|
|
|
#endif
|