Skip to content

Commit 55dd913

Browse files
committed
Add utfcpp to the sources
- Add utfcpp (v4.0.5) to the include directory - Update glm to v1.0.1
1 parent 028f7a5 commit 55dd913

File tree

221 files changed

+9471
-3757
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

221 files changed

+9471
-3757
lines changed

.github/workflows/build.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@ jobs:
4242
- name: Check compilation against static libs
4343
working-directory: ${{github.workspace}}/user_test
4444
run: |
45-
g++ -c ${{github.workspace}}/misc/ci_test_file.cpp $(pkg-config --cflags mygl) -DMYGL_STATIC_DEFINE
45+
g++ -std=c++20 -c ${{github.workspace}}/misc/ci_test_file.cpp $(pkg-config --cflags mygl) -DMYGL_STATIC_DEFINE
4646
g++ ci_test_file.o -o test ${{github.workspace}}/install/lib/x86_64-linux-gnu/libmygl.a -L${{github.workspace}}/install/lib/x86_64-linux-gnu/ -lglfw3 -lfreetype -ldl -lpthread
4747
4848
- name: Check compilation against shared libs
4949
working-directory: ${{github.workspace}}/user_test
5050
run: |
51-
g++ -c ${{github.workspace}}/misc/ci_test_file.cpp $(pkg-config --cflags mygl)
51+
g++ -std=c++20 -c ${{github.workspace}}/misc/ci_test_file.cpp $(pkg-config --cflags mygl)
5252
g++ ci_test_file.o -o test -L${{github.workspace}}/install/lib/x86_64-linux-gnu/ -lmygl -lglfw3 -lfreetype -ldl -lpthread
5353
5454
windows-build:
@@ -79,8 +79,8 @@ jobs:
7979
working-directory: ${{github.workspace}}/user_test
8080
run: |
8181
cp ${{github.workspace}}/install/bin/*.dll .
82-
cl ${{github.workspace}}/misc/ci_test_file.cpp glfw3.lib freetype.lib opengl32.lib gdi32.lib user32.lib shell32.lib winmm.lib /MD /Fe:test /I ${{github.workspace}}/install/include /I ${{github.workspace}}/install/include/MyGL /I ${{github.workspace}}/install/include/freetype2 /D MYGL_STATIC /link /LIBPATH:${{github.workspace}}/install/lib libmygl.a
82+
cl ${{github.workspace}}/misc/ci_test_file.cpp glfw3.lib freetype.lib opengl32.lib gdi32.lib user32.lib shell32.lib winmm.lib /MD /Fe:test /std:latest /I ${{github.workspace}}/install/include /I ${{github.workspace}}/install/include/MyGL /I ${{github.workspace}}/install/include/freetype2 /D MYGL_STATIC /link /LIBPATH:${{github.workspace}}/install/lib libmygl.a
8383

8484
- name: Check compilation against shared libs
8585
working-directory: ${{github.workspace}}/user_test
86-
run: cl ${{github.workspace}}/misc/ci_test_file.cpp mygl.lib glfw3.lib freetype.lib opengl32.lib gdi32.lib user32.lib shell32.lib winmm.lib /MD /Fe:test /I ${{github.workspace}}/install/include /I ${{github.workspace}}/install/include/MyGL /I ${{github.workspace}}/install/include/freetype2 /link /LIBPATH:${{github.workspace}}/install/lib
86+
run: cl ${{github.workspace}}/misc/ci_test_file.cpp mygl.lib glfw3.lib freetype.lib opengl32.lib gdi32.lib user32.lib shell32.lib winmm.lib /MD /Fe:test /std:latest /I ${{github.workspace}}/install/include /I ${{github.workspace}}/install/include/MyGL /I ${{github.workspace}}/install/include/freetype2 /link /LIBPATH:${{github.workspace}}/install/lib

include/MyGL/Drawable/Text.hpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#include "Rectangle.hpp"
88
#include <iterator>
99
#include <string_view>
10-
#include <utf8.h>
10+
#include <utfcpp/utf8.h>
1111

1212
namespace my
1313
{
@@ -32,6 +32,8 @@ namespace my
3232
utf8::utf32to8(view.begin(), view.end(), std::back_inserter(result));
3333
return result;
3434
} else {
35+
// Some compilers need a templated expression or they always trigger
36+
// the assertion when using `static_assert(false, ...)`
3537
static_assert(sizeof(CharType) == 0, "Unknown character encoding");
3638
}
3739
}

include/glm/CMakeLists.txt

-70
This file was deleted.

include/glm/common.hpp

+8-8
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ namespace glm
5151
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/sign.xml">GLSL sign man page</a>
5252
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
5353
template<length_t L, typename T, qualifier Q>
54-
GLM_FUNC_DECL vec<L, T, Q> sign(vec<L, T, Q> const& x);
54+
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> sign(vec<L, T, Q> const& x);
5555

5656
/// Returns a value equal to the nearest integer that is less then or equal to x.
5757
///
@@ -306,13 +306,13 @@ namespace glm
306306
/// glm::vec4 u = glm::mix(g, h, r); // Interpolations can be perform per component with a vector for the last parameter.
307307
/// @endcode
308308
template<typename genTypeT, typename genTypeU>
309-
GLM_FUNC_DECL genTypeT mix(genTypeT x, genTypeT y, genTypeU a);
309+
GLM_FUNC_DECL GLM_CONSTEXPR genTypeT mix(genTypeT x, genTypeT y, genTypeU a);
310310

311311
template<length_t L, typename T, typename U, qualifier Q>
312-
GLM_FUNC_DECL vec<L, T, Q> mix(vec<L, T, Q> const& x, vec<L, T, Q> const& y, vec<L, U, Q> const& a);
312+
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> mix(vec<L, T, Q> const& x, vec<L, T, Q> const& y, vec<L, U, Q> const& a);
313313

314314
template<length_t L, typename T, typename U, qualifier Q>
315-
GLM_FUNC_DECL vec<L, T, Q> mix(vec<L, T, Q> const& x, vec<L, T, Q> const& y, U a);
315+
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> mix(vec<L, T, Q> const& x, vec<L, T, Q> const& y, U a);
316316

317317
/// Returns 0.0 if x < edge, otherwise it returns 1.0 for each component of a genType.
318318
///
@@ -404,7 +404,7 @@ namespace glm
404404
///
405405
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/floatBitsToInt.xml">GLSL floatBitsToInt man page</a>
406406
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
407-
GLM_FUNC_DECL int floatBitsToInt(float const& v);
407+
GLM_FUNC_DECL int floatBitsToInt(float v);
408408

409409
/// Returns a signed integer value representing
410410
/// the encoding of a floating-point value. The floatingpoint
@@ -424,7 +424,7 @@ namespace glm
424424
///
425425
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/floatBitsToUint.xml">GLSL floatBitsToUint man page</a>
426426
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
427-
GLM_FUNC_DECL uint floatBitsToUint(float const& v);
427+
GLM_FUNC_DECL uint floatBitsToUint(float v);
428428

429429
/// Returns a unsigned integer value representing
430430
/// the encoding of a floating-point value. The floatingpoint
@@ -446,7 +446,7 @@ namespace glm
446446
///
447447
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/intBitsToFloat.xml">GLSL intBitsToFloat man page</a>
448448
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
449-
GLM_FUNC_DECL float intBitsToFloat(int const& v);
449+
GLM_FUNC_DECL float intBitsToFloat(int v);
450450

451451
/// Returns a floating-point value corresponding to a signed
452452
/// integer encoding of a floating-point value.
@@ -470,7 +470,7 @@ namespace glm
470470
///
471471
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/uintBitsToFloat.xml">GLSL uintBitsToFloat man page</a>
472472
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
473-
GLM_FUNC_DECL float uintBitsToFloat(uint const& v);
473+
GLM_FUNC_DECL float uintBitsToFloat(uint v);
474474

475475
/// Returns a floating-point value corresponding to a
476476
/// unsigned integer encoding of a floating-point value.

include/glm/copying.txt

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
================================================================================
22
OpenGL Mathematics (GLM)
33
--------------------------------------------------------------------------------
4-
GLM is licensed under The Happy Bunny License and MIT License
4+
GLM is licensed under The Happy Bunny License or MIT License
55

66
================================================================================
77
The Happy Bunny License (Modified MIT License)
88
--------------------------------------------------------------------------------
9-
Copyright (c) 2005 - 2014 G-Truc Creation
9+
Copyright (c) 2005 - G-Truc Creation
1010

1111
Permission is hereby granted, free of charge, to any person obtaining a copy
1212
of this software and associated documentation files (the "Software"), to deal
@@ -33,7 +33,7 @@ THE SOFTWARE.
3333
================================================================================
3434
The MIT License
3535
--------------------------------------------------------------------------------
36-
Copyright (c) 2005 - 2014 G-Truc Creation
36+
Copyright (c) 2005 - G-Truc Creation
3737

3838
Permission is hereby granted, free of charge, to any person obtaining a copy
3939
of this software and associated documentation files (the "Software"), to deal
@@ -51,4 +51,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
5151
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
5252
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
5353
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
54-
THE SOFTWARE.
54+
THE SOFTWARE.

include/glm/detail/_swizzle.hpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ namespace detail
88
struct _swizzle_base0
99
{
1010
protected:
11-
GLM_FUNC_QUALIFIER T& elem(size_t i){ return (reinterpret_cast<T*>(_buffer))[i]; }
12-
GLM_FUNC_QUALIFIER T const& elem(size_t i) const{ return (reinterpret_cast<const T*>(_buffer))[i]; }
11+
GLM_FUNC_QUALIFIER T& elem(int i){ return (reinterpret_cast<T*>(_buffer))[i]; }
12+
GLM_FUNC_QUALIFIER T const& elem(int i) const{ return (reinterpret_cast<const T*>(_buffer))[i]; }
1313

1414
// Use an opaque buffer to *ensure* the compiler doesn't call a constructor.
1515
// The size 1 buffer is assumed to aligned to the actual members so that the
@@ -113,12 +113,12 @@ namespace detail
113113
_apply_op(that, op_div());
114114
}
115115

116-
GLM_FUNC_QUALIFIER T& operator[](size_t i)
116+
GLM_FUNC_QUALIFIER T& operator[](int i)
117117
{
118118
const int offset_dst[4] = { E0, E1, E2, E3 };
119119
return this->elem(offset_dst[i]);
120120
}
121-
GLM_FUNC_QUALIFIER T operator[](size_t i) const
121+
GLM_FUNC_QUALIFIER T operator[](int i) const
122122
{
123123
const int offset_dst[4] = { E0, E1, E2, E3 };
124124
return this->elem(offset_dst[i]);
@@ -147,7 +147,7 @@ namespace detail
147147

148148
GLM_FUNC_QUALIFIER _swizzle_base2& operator= (Stub const&) { return *this; }
149149

150-
GLM_FUNC_QUALIFIER T operator[] (size_t i) const
150+
GLM_FUNC_QUALIFIER T operator[] (int i) const
151151
{
152152
const int offset_dst[4] = { E0, E1, E2, E3 };
153153
return this->elem(offset_dst[i]);

include/glm/detail/_swizzle_func.hpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,40 @@
11
#pragma once
22

33
#define GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, CONST, A, B) \
4-
vec<2, T, Q> A ## B() CONST \
4+
GLM_FUNC_QUALIFIER vec<2, T, Q> A ## B() CONST \
55
{ \
66
return vec<2, T, Q>(this->A, this->B); \
77
}
88

99
#define GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, CONST, A, B, C) \
10-
vec<3, T, Q> A ## B ## C() CONST \
10+
GLM_FUNC_QUALIFIER vec<3, T, Q> A ## B ## C() CONST \
1111
{ \
1212
return vec<3, T, Q>(this->A, this->B, this->C); \
1313
}
1414

1515
#define GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, CONST, A, B, C, D) \
16-
vec<4, T, Q> A ## B ## C ## D() CONST \
16+
GLM_FUNC_QUALIFIER vec<4, T, Q> A ## B ## C ## D() CONST \
1717
{ \
1818
return vec<4, T, Q>(this->A, this->B, this->C, this->D); \
1919
}
2020

2121
#define GLM_SWIZZLE_GEN_VEC2_ENTRY_DEF(T, P, L, CONST, A, B) \
2222
template<typename T> \
23-
vec<L, T, Q> vec<L, T, Q>::A ## B() CONST \
23+
GLM_FUNC_QUALIFIER vec<L, T, Q> vec<L, T, Q>::A ## B() CONST \
2424
{ \
2525
return vec<2, T, Q>(this->A, this->B); \
2626
}
2727

2828
#define GLM_SWIZZLE_GEN_VEC3_ENTRY_DEF(T, P, L, CONST, A, B, C) \
2929
template<typename T> \
30-
vec<3, T, Q> vec<L, T, Q>::A ## B ## C() CONST \
30+
GLM_FUNC_QUALIFIER vec<3, T, Q> vec<L, T, Q>::A ## B ## C() CONST \
3131
{ \
3232
return vec<3, T, Q>(this->A, this->B, this->C); \
3333
}
3434

3535
#define GLM_SWIZZLE_GEN_VEC4_ENTRY_DEF(T, P, L, CONST, A, B, C, D) \
3636
template<typename T> \
37-
vec<4, T, Q> vec<L, T, Q>::A ## B ## C ## D() CONST \
37+
GLM_FUNC_QUALIFIER vec<4, T, Q> vec<L, T, Q>::A ## B ## C ## D() CONST \
3838
{ \
3939
return vec<4, T, Q>(this->A, this->B, this->C, this->D); \
4040
}

include/glm/detail/compute_common.hpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,19 @@ namespace detail
1616
GLM_FUNC_QUALIFIER GLM_CONSTEXPR static genFIType call(genFIType x)
1717
{
1818
GLM_STATIC_ASSERT(
19-
std::numeric_limits<genFIType>::is_iec559 || std::numeric_limits<genFIType>::is_signed,
19+
std::numeric_limits<genFIType>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT || std::numeric_limits<genFIType>::is_signed,
2020
"'abs' only accept floating-point and integer scalar or vector inputs");
2121

2222
return x >= genFIType(0) ? x : -x;
2323
// TODO, perf comp with: *(((int *) &x) + 1) &= 0x7fffffff;
2424
}
2525
};
2626

27-
#if GLM_COMPILER & GLM_COMPILER_CUDA
27+
#if (GLM_COMPILER & GLM_COMPILER_CUDA) || (GLM_COMPILER & GLM_COMPILER_HIP)
2828
template<>
2929
struct compute_abs<float, true>
3030
{
31-
GLM_FUNC_QUALIFIER GLM_CONSTEXPR static float call(float x)
31+
GLM_FUNC_QUALIFIER static float call(float x)
3232
{
3333
return fabsf(x);
3434
}

0 commit comments

Comments
 (0)