From 26d2eb5b22753d426ca0de2a26630cdbb4120377 Mon Sep 17 00:00:00 2001 From: Jesse Talavera-Greenberg Date: Tue, 8 Nov 2016 15:50:21 -0500 Subject: [PATCH 1/6] Add my old proofread text to Section 1 --- manual.md | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/manual.md b/manual.md index d4f6d22d..a5ef9035 100644 --- a/manual.md +++ b/manual.md @@ -7,10 +7,10 @@ --- ## Table of Contents + [0. Licenses](#section0) -+ [1. Getting started](#section1) ++ [1. Getting Started](#section1) + [1.1. Setup](#section1_1) -+ [1.2. Faster program compilation](#section1_2) -+ [1.3. Use sample of GLM core](#section1_3) ++ [1.2. Faster Compilation](#section1_2) ++ [1.3. Example Usage](#section1_3) + [1.4. Dependencies](#section1_4) + [2. Swizzle operators](#section2) + [2.1. Standard C++98 implementation](#section2_1) @@ -137,10 +137,11 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ![](https://github.com/g-truc/glm/blob/manual/doc/manual/frontpage2.png) --- -## 1. Getting started +## 1. Getting Started ### 1.1. Setup -GLM is a header only library. Hence, there is nothing to build to use it. To use GLM, merely include <glm/glm.hpp> header. This include provides all the GLSL features implemented by GLM. +GLM is a header-only library, and thus does not need to be compiled. To use GLM, merely include the `` header, which provides GLSL's mathematics functionality. + Core GLM features can be included using individual headers to allow faster user program compilations. @@ -167,23 +168,21 @@ Core GLM features can be included using individual headers to allow faster user #include // all the GLSL vector relational functions ``` -### 1.2. Faster program compilation +### 1.2. Faster Compilation -GLM is a header only library that makes a heavy usage of C++ templates. -This design may significantly increase the compile time for files that use GLM. Hence, it is important to limit GLM inclusion to header and source files that actually use it. Likewise, GLM extensions should be -included only in program sources using them. +GLM makes heavy use of C++ templates, which may significantly increase the compile time for projects that use GLM. Hence, source files should only include the GLM headers they actually use. -To further help compilation time, GLM 0.9.5 introduced <glm/fwd.hpp> that provides forward declarations of GLM types. +To further reduce compilation time, include ``, which provides forward declarations of all types should their full definitions not be needed. ```cpp // Header file (forward declarations only) #include // Source file (actual implementation) -#include ; +#include ``` -### 1.3. Use sample of GLM core +### 1.3. Example Usage ```cpp // Include GLM core features @@ -208,12 +207,9 @@ glm::mat4 transform(glm::vec2 const& Orientation, glm::vec3 const& Translate, gl ### 1.4. Dependencies -When <glm/glm.hpp> is included, GLM provides all the GLSL features it implements in C++. +The `` header provides all standard GLSL features. -There is no dependence with external libraries or external headers such as gl.h, [*glcorearb.h*](http://www.opengl.org/registry/api/GL/glcorearb.h), gl3.h, glu.h or windows.h. However, if <boost/static\_assert.hpp> -is included, [*Boost static assert*](http://www.boost.org/doc/libs/1_52_0/doc/html/boost_staticassert.html) will be used all over GLM code to provide compiled time errors unless -GLM is built with a C++ 11 compiler in which case [static\_assert](http://en.cppreference.com/w/cpp/language/static_assert). -If neither are detected, GLM will rely on its own implementation of static assert. +GLM does not depend on external libraries or external headers such as ``, [``](http://www.opengl.org/registry/api/GL/glcorearb.h), ``, ``, or ``. However, if `` is included, then [`Boost.StaticAssert`](http://www.boost.org/doc/libs/release/libs/static_assert) will be used to provide compile-time errors. Otherwise, if using a C++11 compiler, the standard `static_assert` will be used instead. If neither is available, GLM will use its own implementation of `static_assert`. --- ## 2. Swizzle operators From a45aad23571f6c4d0d1243f0de5cfd9f44662df4 Mon Sep 17 00:00:00 2001 From: Jesse Talavera-Greenberg Date: Sat, 12 Nov 2016 17:59:13 -0500 Subject: [PATCH 2/6] Revert to original title-case style for now --- manual.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/manual.md b/manual.md index 345049db..ac908342 100644 --- a/manual.md +++ b/manual.md @@ -7,10 +7,10 @@ --- ## Table of Contents + [0. Licenses](#section0) -+ [1. Getting Started](#section1) ++ [1. Getting started](#section1) + [1.1. Setup](#section1_1) -+ [1.2. Faster Compilation](#section1_2) -+ [1.3. Example Usage](#section1_3) ++ [1.2. Faster compilation](#section1_2) ++ [1.3. Example usage](#section1_3) + [1.4. Dependencies](#section1_4) + [2. Swizzle operators](#section2) + [2.1. Standard C++98 implementation](#section2_1) @@ -137,7 +137,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --- -## 1. Getting Started +## 1. Getting started ### 1.1. Setup GLM is a header-only library, and thus does not need to be compiled. To use GLM, merely include the `` header, which provides GLSL's mathematics functionality. @@ -167,7 +167,7 @@ Core GLM features can be included using individual headers to allow faster user #include // all the GLSL trigonometric functions #include // all the GLSL vector relational functions ``` -### 1.2. Faster Compilation +### 1.2. Faster compilation GLM makes heavy use of C++ templates, which may significantly increase the compile time for projects that use GLM. Hence, source files should only include the GLM headers they actually use. @@ -181,7 +181,7 @@ To further reduce compilation time, include ``, which provides forw #include ``` -### 1.3. Example Usage +### 1.3. Example usage ```cpp From 284ea2a205ab50cb6c18f7a7ce7592aac57dbd8b Mon Sep 17 00:00:00 2001 From: Jesse Talavera-Greenberg Date: Sat, 12 Nov 2016 18:01:12 -0500 Subject: [PATCH 3/6] Make the #includes in the Dependencies section of the manual valid - Oops --- manual.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manual.md b/manual.md index ac908342..db6a9f79 100644 --- a/manual.md +++ b/manual.md @@ -209,7 +209,7 @@ glm::mat4 transform(glm::vec2 const& Orientation, glm::vec3 const& Translate, gl The `` header provides all standard GLSL features. -GLM does not depend on external libraries or external headers such as ``, [``](http://www.opengl.org/registry/api/GL/glcorearb.h), ``, ``, or ``. However, if `` is included, then [`Boost.StaticAssert`](http://www.boost.org/doc/libs/release/libs/static_assert) will be used to provide compile-time errors. Otherwise, if using a C++11 compiler, the standard `static_assert` will be used instead. If neither is available, GLM will use its own implementation of `static_assert`. +GLM does not depend on external libraries or external headers such as ``, [``](http://www.opengl.org/registry/api/GL/glcorearb.h), ``, ``, or ``. However, if `` is included, then [`Boost.StaticAssert`](http://www.boost.org/doc/libs/release/libs/static_assert) will be used to provide compile-time errors. Otherwise, if using a C++11 compiler, the standard `static_assert` will be used instead. If neither is available, GLM will use its own implementation of `static_assert`. --- ## 2. Swizzle operators From c8fb1b22372726ee31203df8d46c57ba10b3895d Mon Sep 17 00:00:00 2001 From: Jesse Talavera-Greenberg Date: Sat, 12 Nov 2016 18:44:51 -0500 Subject: [PATCH 4/6] Remove an irrelevant sentence --- manual.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/manual.md b/manual.md index db6a9f79..1434df92 100644 --- a/manual.md +++ b/manual.md @@ -207,8 +207,6 @@ glm::mat4 transform(glm::vec2 const& Orientation, glm::vec3 const& Translate, gl ### 1.4. Dependencies -The `` header provides all standard GLSL features. - GLM does not depend on external libraries or external headers such as ``, [``](http://www.opengl.org/registry/api/GL/glcorearb.h), ``, ``, or ``. However, if `` is included, then [`Boost.StaticAssert`](http://www.boost.org/doc/libs/release/libs/static_assert) will be used to provide compile-time errors. Otherwise, if using a C++11 compiler, the standard `static_assert` will be used instead. If neither is available, GLM will use its own implementation of `static_assert`. --- From 2b241289f3252af3f131ba3595f1a99e316e1889 Mon Sep 17 00:00:00 2001 From: Jesse Talavera-Greenberg Date: Sat, 12 Nov 2016 18:46:06 -0500 Subject: [PATCH 5/6] Tidy up some sentences --- manual.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/manual.md b/manual.md index 1434df92..7c1f5ab9 100644 --- a/manual.md +++ b/manual.md @@ -142,8 +142,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. GLM is a header-only library, and thus does not need to be compiled. To use GLM, merely include the `` header, which provides GLSL's mathematics functionality. - -Core GLM features can be included using individual headers to allow faster user program compilations. +Features can also be included individually to shorten compilation times. ```cpp #include // vec2, bvec2, dvec2, ivec2 and uvec2 @@ -169,9 +168,9 @@ Core GLM features can be included using individual headers to allow faster user ``` ### 1.2. Faster compilation -GLM makes heavy use of C++ templates, which may significantly increase the compile time for projects that use GLM. Hence, source files should only include the GLM headers they actually use. +GLM uses C++ templates heavily, and may significantly increase compilation times for projects that use it. Hence, source files should only include the headers they actually use. -To further reduce compilation time, include ``, which provides forward declarations of all types should their full definitions not be needed. +To reduce compilation time, we can include ``, which forward-declares all types should their definitions not be needed. ```cpp // Header file (forward declarations only) @@ -207,7 +206,7 @@ glm::mat4 transform(glm::vec2 const& Orientation, glm::vec3 const& Translate, gl ### 1.4. Dependencies -GLM does not depend on external libraries or external headers such as ``, [``](http://www.opengl.org/registry/api/GL/glcorearb.h), ``, ``, or ``. However, if `` is included, then [`Boost.StaticAssert`](http://www.boost.org/doc/libs/release/libs/static_assert) will be used to provide compile-time errors. Otherwise, if using a C++11 compiler, the standard `static_assert` will be used instead. If neither is available, GLM will use its own implementation of `static_assert`. +GLM does not depend on external libraries or headers such as ``, [``](http://www.opengl.org/registry/api/GL/glcorearb.h), ``, ``, or ``. However, if we include ``, then [`Boost.StaticAssert`](http://www.boost.org/doc/libs/release/libs/static_assert) will be used to provide compile-time errors. Otherwise, if using a C++11 compiler, the standard `static_assert` will be used instead. If neither is available, GLM will use its own implementation of `static_assert`. --- ## 2. Swizzle operators From 9b302bd87174ccaa8a9d1209dcb5f0d6793b08a3 Mon Sep 17 00:00:00 2001 From: Jesse Talavera-Greenberg Date: Sat, 12 Nov 2016 18:46:17 -0500 Subject: [PATCH 6/6] More proofreading --- manual.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/manual.md b/manual.md index 7c1f5ab9..39b738e1 100644 --- a/manual.md +++ b/manual.md @@ -140,7 +140,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ## 1. Getting started ### 1.1. Setup -GLM is a header-only library, and thus does not need to be compiled. To use GLM, merely include the `` header, which provides GLSL's mathematics functionality. +GLM is a header-only library, and thus does not need to be compiled. We can use GLM's implementation of GLSL's mathematics functionality by including the `` header. The library can also be installed with CMake, though the details of doing so will differ depending on the target build system. Features can also be included individually to shorten compilation times. @@ -176,10 +176,13 @@ To reduce compilation time, we can include ``, which forward-declar // Header file (forward declarations only) #include -// Source file (actual implementation) -#include +// At this point, we don't care what exactly makes up a vec2; that won't matter +// until we write this function's implementation. +glm::vec2 functionDeclaration(const glm::vec2& input); ``` +Precompiled headers will also be helpful, though are not covered by this manual. + ### 1.3. Example usage