diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml index f603881..dfcccbb 100644 --- a/.idea/codeStyles/Project.xml +++ b/.idea/codeStyles/Project.xml @@ -1,7 +1,22 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index f6b6147..bd0f08f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -87,7 +87,7 @@ add_library(skunkworks STATIC src/types.c src/vec2i.c src/vertex_buffer.c - src/window.c) + src/window.c include/vec2f.h src/vec2f.c src/vec4f.c include/vec4f.h) add_executable(skip tools/skip.c) diff --git a/include/vec2f.h b/include/vec2f.h new file mode 100644 index 0000000..a06f5a0 --- /dev/null +++ b/include/vec2f.h @@ -0,0 +1,12 @@ +#ifndef GUARD_A01629497D8E42B4B3FB585B56C21AEF +#define GUARD_A01629497D8E42B4B3FB585B56C21AEF + +#include "types.h" + +struct sw_vec2f { + f32 x, y; +}; + +struct sw_vec2f sw_vec2f(f32 x, f32 y); + +#endif /* GUARD_A01629497D8E42B4B3FB585B56C21AEF */ diff --git a/include/vec4f.h b/include/vec4f.h new file mode 100644 index 0000000..49d15a8 --- /dev/null +++ b/include/vec4f.h @@ -0,0 +1,27 @@ +#ifndef GUARD_CB04704744FE48F78C6B68B66393739B +#define GUARD_CB04704744FE48F78C6B68B66393739B + +#include "types.h" + +struct sw_vec4f { + union { + f32 x; + f32 r; + }; + union { + f32 y; + f32 g; + }; + union { + f32 z; + f32 b; + }; + union { + f32 w; + f32 a; + }; +}; + +struct sw_vec4f sw_vec4f(f32 x, f32 y, f32 z, f32 w); + +#endif /* GUARD_CB04704744FE48F78C6B68B66393739B */ diff --git a/src/vec2f.c b/src/vec2f.c new file mode 100644 index 0000000..29f416a --- /dev/null +++ b/src/vec2f.c @@ -0,0 +1,10 @@ +#include "vec2f.h" + +struct sw_vec2f sw_vec2f(f32 x, f32 y) { + struct sw_vec2f vec; + + vec.x = x; + vec.y = y; + + return vec; +} diff --git a/src/vec4f.c b/src/vec4f.c new file mode 100644 index 0000000..c9f112b --- /dev/null +++ b/src/vec4f.c @@ -0,0 +1,12 @@ +#include "vec4f.h" + +struct sw_vec4f sw_vec4f(f32 x, f32 y, f32 z, f32 w) { + struct sw_vec4f vec; + + vec.x = x; + vec.y = y; + vec.z = z; + vec.w = w; + + return vec; +}