Add ivec3 and ivec4 files

This commit is contained in:
Christopher Lang
2022-05-17 16:04:47 +01:00
parent ee09707c1c
commit d582146d9a
13 changed files with 213 additions and 0 deletions

View File

@@ -16,6 +16,8 @@ extern "C" {
#include "call/vec3.h"
#include "call/vec4.h"
#include "call/ivec2.h"
#include "call/ivec3.h"
#include "call/ivec4.h"
#include "call/mat2.h"
#include "call/mat3.h"
#include "call/mat4.h"

23
include/cglm/call/ivec3.h Normal file
View File

@@ -0,0 +1,23 @@
/*
* Copyright (c), Recep Aslantas.
*
* MIT License (MIT), http://opensource.org/licenses/MIT
* Full license can be found in the LICENSE file
*/
#ifndef cglmc_ivec3_h
#define cglmc_ivec3_h
#ifdef __cplusplus
extern "C" {
#endif
#include "../cglm.h"
CGLM_EXPORT
void
glmc_ivec3(int * __restrict v, ivec3 dest);
#ifdef __cplusplus
}
#endif
#endif /* cglmc_ivec3_h */

23
include/cglm/call/ivec4.h Normal file
View File

@@ -0,0 +1,23 @@
/*
* Copyright (c), Recep Aslantas.
*
* MIT License (MIT), http://opensource.org/licenses/MIT
* Full license can be found in the LICENSE file
*/
#ifndef cglmc_ivec4_h
#define cglmc_ivec4_h
#ifdef __cplusplus
extern "C" {
#endif
#include "../cglm.h"
CGLM_EXPORT
void
glmc_ivec4(ivec3 v3, int last, ivec4 dest);
#ifdef __cplusplus
}
#endif
#endif /* cglmc_ivec4_h */

View File

@@ -13,6 +13,8 @@
#include "vec3.h"
#include "vec4.h"
#include "ivec2.h"
#include "ivec3.h"
#include "ivec4.h"
#include "mat4.h"
#include "mat3.h"
#include "mat2.h"

32
include/cglm/ivec3.h Normal file
View File

@@ -0,0 +1,32 @@
/*
* Copyright (c), Recep Aslantas.
*
* MIT License (MIT), http://opensource.org/licenses/MIT
* Full license can be found in the LICENSE file
*/
/*
FUNCTIONS:
CGLM_INLINE void glm_ivec3(int * __restrict v, ivec3 dest)
*/
#ifndef cglm_ivec3_h
#define cglm_ivec3_h
#include "common.h"
/*!
* @brief init ivec3 using another vector
*
* @param[in] v a vector
* @param[out] dest destination
*/
CGLM_INLINE
void
glm_ivec3(int * __restrict v, ivec3 dest) {
dest[0] = v[0];
dest[1] = v[1];
dest[2] = v[2];
}
#endif /* cglm_ivec3_h */

34
include/cglm/ivec4.h Normal file
View File

@@ -0,0 +1,34 @@
/*
* Copyright (c), Recep Aslantas.
*
* MIT License (MIT), http://opensource.org/licenses/MIT
* Full license can be found in the LICENSE file
*/
/*
FUNCTIONS:
CGLM_INLINE void glm_ivec4(int * __restrict v, ivec4 dest)
*/
#ifndef cglm_ivec4_h
#define cglm_ivec4_h
#include "common.h"
/*!
* @brief init ivec4 using ivec3
*
* @param[in] v3 vector3
* @param[in] last last item
* @param[out] dest destination
*/
CGLM_INLINE
void
glm_ivec4(ivec3 v3, int last, ivec4 dest) {
dest[0] = v3[0];
dest[1] = v3[1];
dest[2] = v3[2];
dest[3] = last;
}
#endif /* cglm_ivec4_h */