Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove implementation files, make same API for inlining and shared library #135

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 17 additions & 8 deletions include/cglm/affine-mat.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

/*
Functions:
CGLM_INLINE void glm_mul(mat4 m1, mat4 m2, mat4 dest);
CGLM_INLINE void glm_inv_tr(mat4 mat);
CGLM_DECL void glm_mul(mat4 m1, mat4 m2, mat4 dest);
CGLM_DECL void glm_inv_tr(mat4 mat);
*/

#ifndef cglm_affine_mat_h
Expand Down Expand Up @@ -42,9 +42,11 @@
* @param[in] m2 affine matrix 2
* @param[out] dest result matrix
*/
CGLM_INLINE
CGLM_DECL
void
glm_mul(mat4 m1, mat4 m2, mat4 dest) {
glm_mul(mat4 m1, mat4 m2, mat4 dest) CGLM_ENDD
#ifndef CGLM_LIB
{
#ifdef __AVX__
glm_mul_avx(m1, m2, dest);
#elif defined( __SSE__ ) || defined( __SSE2__ )
Expand Down Expand Up @@ -81,6 +83,7 @@ glm_mul(mat4 m1, mat4 m2, mat4 dest) {
dest[3][3] = a03 * b30 + a13 * b31 + a23 * b32 + a33 * b33;
#endif
}
#endif

/*!
* @brief this is similar to glm_mat4_mul but specialized to affine transform
Expand All @@ -98,9 +101,11 @@ glm_mul(mat4 m1, mat4 m2, mat4 dest) {
* @param[in] m2 affine matrix 2
* @param[out] dest result matrix
*/
CGLM_INLINE
CGLM_DECL
void
glm_mul_rot(mat4 m1, mat4 m2, mat4 dest) {
glm_mul_rot(mat4 m1, mat4 m2, mat4 dest) CGLM_ENDD
#ifndef CGLM_LIB
{
#if defined( __SSE__ ) || defined( __SSE2__ )
glm_mul_rot_sse2(m1, m2, dest);
#else
Expand Down Expand Up @@ -134,6 +139,7 @@ glm_mul_rot(mat4 m1, mat4 m2, mat4 dest) {
dest[3][3] = a33;
#endif
}
#endif

/*!
* @brief inverse orthonormal rotation + translation matrix (ridig-body)
Expand All @@ -145,9 +151,11 @@ glm_mul_rot(mat4 m1, mat4 m2, mat4 dest) {
*
* @param[in,out] mat matrix
*/
CGLM_INLINE
CGLM_DECL
void
glm_inv_tr(mat4 mat) {
glm_inv_tr(mat4 mat) CGLM_ENDD
#ifndef CGLM_LIB
{
#if defined( __SSE__ ) || defined( __SSE2__ )
glm_inv_tr_sse2(mat);
#else
Expand All @@ -164,5 +172,6 @@ glm_inv_tr(mat4 mat) {
glm_vec3_copy(t, mat[3]);
#endif
}
#endif

#endif /* cglm_affine_mat_h */
Loading