added vec2f and vec4f

This commit is contained in:
DaniTheSkunk 2023-04-15 02:21:49 +00:00
parent 0df808899b
commit 3ea92c4618
6 changed files with 77 additions and 1 deletions

View File

@ -1,7 +1,22 @@
<component name="ProjectCodeStyleConfiguration"> <component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173"> <code_scheme name="Project" version="173">
<Objective-C>
<option name="HEADER_GUARD_STYLE_PATTERN" value="GUARD_${UUID}" />
</Objective-C>
<clangFormatSettings> <clangFormatSettings>
<option name="ENABLED" value="true" /> <option name="ENABLED" value="true" />
</clangFormatSettings> </clangFormatSettings>
<files>
<extensions>
<pair source="c" header="h" fileNamingConvention="SNAKE_CASE" />
<pair source="cu" header="cuh" fileNamingConvention="NONE" />
<pair source="ixx" header="" fileNamingConvention="NONE" />
<pair source="mxx" header="" fileNamingConvention="NONE" />
<pair source="cppm" header="" fileNamingConvention="NONE" />
<pair source="ccm" header="" fileNamingConvention="NONE" />
<pair source="cxxm" header="" fileNamingConvention="NONE" />
<pair source="c++m" header="" fileNamingConvention="NONE" />
</extensions>
</files>
</code_scheme> </code_scheme>
</component> </component>

View File

@ -87,7 +87,7 @@ add_library(skunkworks STATIC
src/types.c src/types.c
src/vec2i.c src/vec2i.c
src/vertex_buffer.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 add_executable(skip
tools/skip.c) tools/skip.c)

12
include/vec2f.h Normal file
View File

@ -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 */

27
include/vec4f.h Normal file
View File

@ -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 */

10
src/vec2f.c Normal file
View File

@ -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;
}

12
src/vec4f.c Normal file
View File

@ -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;
}