mirror of
https://github.com/g-truc/glm.git
synced 2024-11-30 03:44:38 +00:00
Add my old proofread text to Section 1
This commit is contained in:
parent
3db25febee
commit
26d2eb5b22
30
manual.md
30
manual.md
@ -7,10 +7,10 @@
|
|||||||
---
|
---
|
||||||
## Table of Contents
|
## Table of Contents
|
||||||
+ [0. Licenses](#section0)
|
+ [0. Licenses](#section0)
|
||||||
+ [1. Getting started](#section1)
|
+ [1. Getting Started](#section1)
|
||||||
+ [1.1. Setup](#section1_1)
|
+ [1.1. Setup](#section1_1)
|
||||||
+ [1.2. Faster program compilation](#section1_2)
|
+ [1.2. Faster Compilation](#section1_2)
|
||||||
+ [1.3. Use sample of GLM core](#section1_3)
|
+ [1.3. Example Usage](#section1_3)
|
||||||
+ [1.4. Dependencies](#section1_4)
|
+ [1.4. Dependencies](#section1_4)
|
||||||
+ [2. Swizzle operators](#section2)
|
+ [2. Swizzle operators](#section2)
|
||||||
+ [2.1. Standard C++98 implementation](#section2_1)
|
+ [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)
|
![](https://github.com/g-truc/glm/blob/manual/doc/manual/frontpage2.png)
|
||||||
|
|
||||||
---
|
---
|
||||||
## 1. Getting started <a name="section1"></a>
|
## 1. Getting Started <a name="section1"></a>
|
||||||
### 1.1. Setup <a name="section1_1"></a>
|
### 1.1. Setup <a name="section1_1"></a>
|
||||||
|
|
||||||
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 `<glm/glm.hpp>` header, which provides GLSL's mathematics functionality.
|
||||||
|
|
||||||
|
|
||||||
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.
|
||||||
|
|
||||||
@ -167,23 +168,21 @@ Core GLM features can be included using individual headers to allow faster user
|
|||||||
#include <glm/vector_relational.hpp> // all the GLSL vector relational functions
|
#include <glm/vector_relational.hpp> // all the GLSL vector relational functions
|
||||||
```
|
```
|
||||||
|
|
||||||
### 1.2. Faster program compilation <a name="section1_2"></a>
|
### 1.2. Faster Compilation <a name="section1_2"></a>
|
||||||
|
|
||||||
GLM is a header only library that makes a heavy usage of C++ templates.
|
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.
|
||||||
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.
|
To further reduce compilation time, include `<glm/fwd.hpp>`, which provides forward declarations of all types should their full definitions not be needed.
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
// Header file (forward declarations only)
|
// Header file (forward declarations only)
|
||||||
#include <glm/fwd.hpp>
|
#include <glm/fwd.hpp>
|
||||||
|
|
||||||
// Source file (actual implementation)
|
// Source file (actual implementation)
|
||||||
#include <glm/glm.hpp>;
|
#include <glm/glm.hpp>
|
||||||
```
|
```
|
||||||
|
|
||||||
### 1.3. Use sample of GLM core <a name="section1_3"></a>
|
### 1.3. Example Usage <a name="section1_3"></a>
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
// Include GLM core features
|
// Include GLM core features
|
||||||
@ -208,12 +207,9 @@ glm::mat4 transform(glm::vec2 const& Orientation, glm::vec3 const& Translate, gl
|
|||||||
|
|
||||||
### 1.4. Dependencies <a name="section1_4"></a>
|
### 1.4. Dependencies <a name="section1_4"></a>
|
||||||
|
|
||||||
When <glm/glm.hpp> is included, GLM provides all the GLSL features it implements in C++.
|
The `<glm/glm.hpp>` 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>
|
GLM does not depend on 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, 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`.
|
||||||
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.
|
|
||||||
|
|
||||||
---
|
---
|
||||||
## 2. Swizzle operators <a name="section2"></a>
|
## 2. Swizzle operators <a name="section2"></a>
|
||||||
|
Loading…
Reference in New Issue
Block a user