boilerplate

This commit is contained in:
Marcin
2025-01-14 17:32:46 +00:00
parent a4cd7e008d
commit 3e52d90ecb
9 changed files with 80 additions and 0 deletions

View File

@@ -93,6 +93,7 @@ add_library(${PROJECT_NAME}
src/mat4x2.c
src/mat4x3.c
src/plane.c
src/perlin.c
src/frustum.c
src/box.c
src/project.c

View File

@@ -67,6 +67,7 @@ cglm_HEADERS = include/cglm/version.h \
include/cglm/util.h \
include/cglm/quat.h \
include/cglm/plane.h \
include/cglm/perlin.h \
include/cglm/frustum.h \
include/cglm/box.h \
include/cglm/aabb2d.h \
@@ -120,6 +121,7 @@ cglm_call_HEADERS = include/cglm/call/mat4.h \
include/cglm/call/quat.h \
include/cglm/call/euler.h \
include/cglm/call/plane.h \
include/cglm/call/perlin.h \
include/cglm/call/frustum.h \
include/cglm/call/box.h \
include/cglm/call/project.h \
@@ -210,6 +212,7 @@ cglm_struct_HEADERS = include/cglm/struct/mat4.h \
include/cglm/struct/quat.h \
include/cglm/struct/euler.h \
include/cglm/struct/plane.h \
include/cglm/struct/perlin.h \
include/cglm/struct/frustum.h \
include/cglm/struct/box.h \
include/cglm/struct/aabb2d.h \
@@ -261,6 +264,7 @@ libcglm_la_SOURCES=\
src/mat4x2.c \
src/mat4x3.c \
src/plane.c \
src/perlin.c \
src/frustum.c \
src/box.c \
src/project.c \

View File

@@ -32,6 +32,7 @@ extern "C" {
#include "call/quat.h"
#include "call/euler.h"
#include "call/plane.h"
#include "call/perlin.h"
#include "call/frustum.h"
#include "call/aabb2d.h"
#include "call/box.h"

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_perlin_h
#define cglmc_perlin_h
#ifdef __cplusplus
extern "C" {
#endif
#include "../cglm.h"
CGLM_EXPORT
float
glmc_perlin(vec4 point);
#ifdef __cplusplus
}
#endif
#endif /* cglmc_perlin_h */

View File

@@ -30,6 +30,7 @@
#include "quat.h"
#include "euler.h"
#include "plane.h"
#include "perlin.h"
#include "aabb2d.h"
#include "box.h"
#include "color.h"

View File

@@ -31,6 +31,7 @@ extern "C" {
#include "struct/affine.h"
#include "struct/frustum.h"
#include "struct/plane.h"
#include "struct/perlin.h"
#include "struct/box.h"
#include "struct/color.h"
#include "struct/io.h"

View File

@@ -0,0 +1,33 @@
/*
* Copyright (c), Recep Aslantas.
*
* MIT License (MIT), http://opensource.org/licenses/MIT
* Full license can be found in the LICENSE file
*/
#ifndef cglms_perlins_h
#define cglms_perlins_h
#include "../common.h"
#include "../types-struct.h"
#include "../perlin.h"
#include "vec4.h"
/*
Functions:
CGLM_INLINE float glms_perlin(vec4s point);
*/
/*!
* @brief Classic perlin noise
*
* @param[in] point 4D vector
* @returns perlin noise value
*/
CGLM_INLINE
float
glms_perlin(vec4s point) {
return glm_perlin(point.raw);
}
#endif /* cglms_perlins_h */

View File

@@ -56,6 +56,7 @@ cglm_src = files(
'src/mat4x2.c',
'src/mat4x3.c',
'src/plane.c',
'src/perlin.c',
'src/frustum.c',
'src/box.c',
'src/project.c',

15
src/perlin.c Normal file
View File

@@ -0,0 +1,15 @@
/*
* Copyright (c), Recep Aslantas.
*
* MIT License (MIT), http://opensource.org/licenses/MIT
* Full license can be found in the LICENSE file
*/
#include "../include/cglm/cglm.h"
#include "../include/cglm/call.h"
CGLM_EXPORT
float
glmc_perlin(vec4 p) {
return glm_perlin(p);
}