Updated manual

master
Christophe Riccio ago%!(EXTRA string=9 years)
parent 936069aa56
commit 3ca24a12a1
  1. 115
      manual.md

@ -104,108 +104,68 @@ reports](https://github.com/g-truc/glm/issues) for bugs and feature
requests. Any feedback is welcome at requests. Any feedback is welcome at
[*glm@g-truc.net*](mailto:glm@g-truc.net). [*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 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
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. GLM.
Core GLM features can be included using individual headers to allow Core GLM features can be included using individual headers to allow faster user program compilations.
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/vec3.hpp>: vec3, bvec3, dvec3, ivec3 and uvec3 * <glm/mat2x2.hpp>: mat2, dmat2
* <glm/mat2x3.hpp>: mat2x3, dmat2x3
<glm/vec4.hpp>: vec4, bvec4, dvec4, ivec4 and uvec4 * <glm/mat2x4.hpp>: mat2x4, dmat2x4
* <glm/mat3x2.hpp>: mat3x2, dmat3x2
<glm/mat2x2.hpp>: mat2, dmat2 * <glm/mat3x3.hpp>: mat3, dmat3
* <glm/mat3x4.hpp>: mat3x4, dmat2
<glm/mat2x3.hpp>: mat2x3, dmat2x3 * <glm/mat4x2.hpp>: mat4x2, dmat4x2
* <glm/mat4x3.hpp>: mat4x3, dmat4x3
<glm/mat2x4.hpp>: mat2x4, dmat2x4 * <glm/mat4x4.hpp>: mat4, dmat4
* <glm/common.hpp>: all the GLSL common functions
<glm/mat3x2.hpp>: mat3x2, dmat3x2 * <glm/exponential.hpp>: all the GLSL exponential functions
* <glm/geometry.hpp>: all the GLSL geometry functions
<glm/mat3x3.hpp>: mat3, dmat3 * <glm/integer.hpp>: all the GLSL integer functions
* <glm/matrix.hpp>: all the GLSL matrix functions
<glm/mat3x4.hpp>: mat3x4, dmat2 * <glm/packing.hpp>: all the GLSL packing functions
* <glm/trigonometric.hpp>: all the GLSL trigonometric functions
<glm/mat4x2.hpp>: mat4x2, dmat4x2 * <glm/vector\_relational.hpp>: all the GLSL vector relational functions
<glm/mat4x3.hpp>: mat4x3, dmat4x3 ### 1.2. Faster program compilation
<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}
-------------------------------
GLM is a header only library that makes a heavy usage of C++ templates. 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 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
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. included only in program sources using them.
To further help compilation time, GLM 0.9.5 introduced To further help compilation time, GLM 0.9.5 introduced
<glm/fwd.hpp> that provides forward declarations of GLM types. <glm/fwd.hpp> that provides forward declarations of GLM types.
------------------------------- ```cpp
// Header file // Header file
#include <glm/fwd.hpp>
\#include &lt;glm/fwd.hpp&gt;
// Source file // Source file
#include <glm/glm.hpp>;
```
\#include &lt;glm/glm.hpp&gt; ### 1.3. Use sample of GLM core
-------------------------------
-------------------------------
1.3. Use sample of GLM core {#use-sample-of-glm-core .HeadingB} ```cpp
---------------------------
---------------------------------------------------------------------------
// Include GLM core features // Include GLM core features
\#include &lt;glm/vec3.hpp&gt; \#include &lt;glm/vec3.hpp&gt;
\#include &lt;glm/vec4.hpp&gt; \#include &lt;glm/vec4.hpp&gt;
\#include &lt;glm/mat4x4.hpp&gt; \#include &lt;glm/mat4x4.hpp&gt;
\#include &lt;glm/trigonometric.hpp&gt; \#include &lt;glm/trigonometric.hpp&gt;
// Include GLM extensions // Include GLM extensions
\#include &lt;glm/gtc/matrix\_transform.hpp&gt; \#include &lt;glm/gtc/matrix\_transform.hpp&gt;
glm::mat4 transform( glm::mat4 transform(
glm::vec2 const& Orientation, glm::vec2 const& Orientation,
glm::vec3 const& Translate, glm::vec3 const& Translate,
glm::vec3 const& Up) glm::vec3 const& Up)
{ {
@ -223,10 +183,9 @@ To further help compilation time, GLM 0.9.5 introduced
return Proj \* View \* Model; return Proj \* View \* Model;
} }
--------------------------------------------------------------------------- ```
---------------------------------------------------------------------------
1.4. Dependencies {#dependencies .HeadingB} ### 1.4. Dependencies {#dependencies .HeadingB}
----------------- -----------------
When &lt;glm/glm.hpp&gt; is included, GLM provides all the GLSL features When &lt;glm/glm.hpp&gt; is included, GLM provides all the GLSL features

Loading…
Cancel
Save