From 3ca24a12a1b3c6480a96666b039599f365a1d138 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Tue, 1 Nov 2016 12:46:33 +0100 Subject: [PATCH] Updated manual --- manual.md | 133 +++++++++++++++++++----------------------------------- 1 file changed, 46 insertions(+), 87 deletions(-) diff --git a/manual.md b/manual.md index df0cd4be..e4e2221d 100644 --- a/manual.md +++ b/manual.md @@ -104,108 +104,68 @@ reports](https://github.com/g-truc/glm/issues) for bugs and feature requests. Any feedback is welcome at [*glm@g-truc.net*](mailto:glm@g-truc.net). -1. Getting started {#getting-started .HeadingA} -================== +--- +## 1. Getting started +### 1.1. Setup -1.1. Setup {#setup .HeadingB} ----------- - -GLM is a header only library. Hence, there is nothing to build to use -it. To use GLM, a programmer only has to include <glm/glm.hpp> in -his program. This include provides all the GLSL features implemented by +GLM is a header only library. Hence, there is nothing to build to use it. To use GLM, a programmer only has to include <glm/glm.hpp> in his program. This include provides all the GLSL features implemented by GLM. -Core GLM features can be included using individual headers to allow -faster user program compilations. +Core GLM features can be included using individual headers to allow faster user program compilations. -<glm/vec2.hpp>: vec2, bvec2, dvec2, ivec2 and uvec2 +* <glm/vec2.hpp>: vec2, bvec2, dvec2, ivec2 and uvec2 +* <glm/vec3.hpp>: vec3, bvec3, dvec3, ivec3 and uvec3 +* <glm/vec4.hpp>: vec4, bvec4, dvec4, ivec4 and uvec4 +* <glm/mat2x2.hpp>: mat2, dmat2 +* <glm/mat2x3.hpp>: mat2x3, dmat2x3 +* <glm/mat2x4.hpp>: mat2x4, dmat2x4 +* <glm/mat3x2.hpp>: mat3x2, dmat3x2 +* <glm/mat3x3.hpp>: mat3, dmat3 +* <glm/mat3x4.hpp>: mat3x4, dmat2 +* <glm/mat4x2.hpp>: mat4x2, dmat4x2 +* <glm/mat4x3.hpp>: mat4x3, dmat4x3 +* <glm/mat4x4.hpp>: mat4, dmat4 +* <glm/common.hpp>: all the GLSL common functions +* <glm/exponential.hpp>: all the GLSL exponential functions +* <glm/geometry.hpp>: all the GLSL geometry functions +* <glm/integer.hpp>: all the GLSL integer functions +* <glm/matrix.hpp>: all the GLSL matrix functions +* <glm/packing.hpp>: all the GLSL packing functions +* <glm/trigonometric.hpp>: all the GLSL trigonometric functions +* <glm/vector\_relational.hpp>: all the GLSL vector relational functions -<glm/vec3.hpp>: vec3, bvec3, dvec3, ivec3 and uvec3 - -<glm/vec4.hpp>: vec4, bvec4, dvec4, ivec4 and uvec4 - -<glm/mat2x2.hpp>: mat2, dmat2 - -<glm/mat2x3.hpp>: mat2x3, dmat2x3 - -<glm/mat2x4.hpp>: mat2x4, dmat2x4 - -<glm/mat3x2.hpp>: mat3x2, dmat3x2 - -<glm/mat3x3.hpp>: mat3, dmat3 - -<glm/mat3x4.hpp>: mat3x4, dmat2 - -<glm/mat4x2.hpp>: mat4x2, dmat4x2 - -<glm/mat4x3.hpp>: mat4x3, dmat4x3 - -<glm/mat4x4.hpp>: mat4, dmat4 - -<glm/common.hpp>: all the GLSL common functions - -<glm/exponential.hpp>: all the GLSL exponential functions - -<glm/geometry.hpp>: all the GLSL geometry functions - -<glm/integer.hpp>: all the GLSL integer functions - -<glm/matrix.hpp>: all the GLSL matrix functions - -<glm/packing.hpp>: all the GLSL packing functions - -<glm/trigonometric.hpp>: all the GLSL trigonometric functions - -<glm/vector\_relational.hpp>: all the GLSL vector relational -functions - -1.2. Faster program compilation {#faster-program-compilation .HeadingB} -------------------------------- +### 1.2. Faster program 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. +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. To further help compilation time, GLM 0.9.5 introduced <glm/fwd.hpp> that provides forward declarations of GLM types. - ------------------------------- - // Header file +```cpp +// Header file +#include - \#include <glm/fwd.hpp> +// Source file +#include ; +``` - // Source file +### 1.3. Use sample of GLM core - \#include <glm/glm.hpp> - ------------------------------- - ------------------------------- +```cpp +// Include GLM core features +\#include <glm/vec3.hpp> +\#include <glm/vec4.hpp> +\#include <glm/mat4x4.hpp> +\#include <glm/trigonometric.hpp> -1.3. Use sample of GLM core {#use-sample-of-glm-core .HeadingB} ---------------------------- - - --------------------------------------------------------------------------- - // Include GLM core features - - \#include <glm/vec3.hpp> - - \#include <glm/vec4.hpp> - - \#include <glm/mat4x4.hpp> - - \#include <glm/trigonometric.hpp> - - // Include GLM extensions - - \#include <glm/gtc/matrix\_transform.hpp> - - glm::mat4 transform( +// Include GLM extensions +\#include <glm/gtc/matrix\_transform.hpp> +glm::mat4 transform( glm::vec2 const& Orientation, - glm::vec3 const& Translate, - glm::vec3 const& Up) { @@ -223,10 +183,9 @@ To further help compilation time, GLM 0.9.5 introduced return Proj \* View \* Model; } - --------------------------------------------------------------------------- - --------------------------------------------------------------------------- +``` -1.4. Dependencies {#dependencies .HeadingB} +### 1.4. Dependencies {#dependencies .HeadingB} ----------------- When <glm/glm.hpp> is included, GLM provides all the GLSL features