Subastra
Loading...
Searching...
No Matches
vec2i.h
Go to the documentation of this file.
1#ifndef __H__VEC2I__
2#define __H__VEC2I__
3
4#include "defs.h"
5#include "vec2.h"
6
7typedef struct {
8 i32 x, y;
9} vec2i;
10
12static vec2i vec2i_new(i32 x, i32 y) {
13 vec2i ret;
14 ret.x = x;
15 ret.y = y;
16 return ret;
17}
18
20static vec2i vec2i_zero() { return vec2i_new(0, 0); }
21
24 vec2 ret;
25 ret.x = v.x;
26 ret.y = v.y;
27 return ret;
28}
29
30static bool vec2_eq(vec2i a, vec2i b) { return a.x == b.x && a.y == b.y; }
31
32#endif
int32_t i32
Definition defs.h:47
Definition vec2.h:11
float y
Definition vec2.h:12
float x
Definition vec2.h:12
Definition vec2i.h:7
i32 y
Definition vec2i.h:8
i32 x
Definition vec2i.h:8
static vec2i vec2i_new(i32 x, i32 y)
{.x = x, .y = y}
Definition vec2i.h:12
static vec2i vec2i_zero()
{.x = 0, .y = 0}
Definition vec2i.h:20
static bool vec2_eq(vec2i a, vec2i b)
Definition vec2i.h:30
static vec2 vec2i_to_vec2(vec2i v)
{.x = (int)v.x, .y = (int)v.y)
Definition vec2i.h:23