mirror of
https://github.com/recp/cglm.git
synced 2025-12-24 20:34:58 +00:00
Update README.md
This commit is contained in:
23
README.md
23
README.md
@@ -31,7 +31,7 @@
|
||||
</a>
|
||||
<br /><br />
|
||||
<a href="#sponsors">
|
||||
<img src="https://opencollective.com/cglm/sponsors/badge.svg"
|
||||
<img sr📚c="https://opencollective.com/cglm/sponsors/badge.svg"
|
||||
alt="Sponsors on Open Collective"/>
|
||||
</a>
|
||||
<a href="#backers">
|
||||
@@ -48,12 +48,12 @@ Highly optimized 2D|3D math library, also known as <b>OpenGL Mathematics (glm) f
|
||||
|
||||
---
|
||||
|
||||
#### Documentation
|
||||
#### 📚 Documentation
|
||||
|
||||
Almost all functions (inline versions) and parameters are documented inside the corresponding headers. <br />
|
||||
Complete documentation: http://cglm.readthedocs.io
|
||||
|
||||
#### Note for previous versions:
|
||||
#### 📌 Note for previous versions:
|
||||
|
||||
- _dup (duplicate) is changed to _copy. For instance `glm_vec_dup -> glm_vec3_copy`
|
||||
- OpenGL related functions are dropped to make this lib platform/third-party independent
|
||||
@@ -68,30 +68,27 @@ you have the latest version
|
||||
- **[major change]** by starting v0.7.3, inline print functions are disabled in release/production mode to eliminate print costs (see options in documentation). Print output also improved. You can disable colors if you need (see documentation)
|
||||
- **[major change]** by starting v0.8.3, **cglm** supports alternative clipspace configuations e.g. Left Handed, Zero-to-One (_zo)... `CGLM_FORCE_DEPTH_ZERO_TO_ONE` and `CGLM_FORCE_LEFT_HANDED` is provided to control clipspace. You should be able to use **cglm** with Vulkan, DirectX and Metal now... see https://cglm.readthedocs.io/en/latest/opt.html#clipspace-option-s
|
||||
|
||||
#### Note for C++ developers:
|
||||
#### 📌 Note for C++ developers:
|
||||
If you are not aware of the original GLM library yet, you may also want to look at:
|
||||
https://github.com/g-truc/glm
|
||||
|
||||
#### Note for new comers (Important):
|
||||
#### 📌 Note for new comers (Important):
|
||||
- `vec4` and `mat4` variables must be aligned. (There will be unaligned versions later)
|
||||
- **in** and **[in, out]** parameters must be initialized (please). But **[out]** parameters not, initializing out param is also redundant
|
||||
- All functions are inline if you don't want to use pre-compiled versions with glmc_ prefix, you can ignore build process. Just include headers.
|
||||
- if your debugger takes you to cglm headers then make sure you are not trying to copy vec4 to vec3 or alig issues...
|
||||
- Welcome!
|
||||
|
||||
#### Note for experienced developers:
|
||||
#### 📌 Note for experienced developers:
|
||||
- Since I'm testing this library in my projects, sometimes bugs occurs; finding that bug[s] and making improvements would be more easy with multiple developer/contributor and their projects or knowledge. Consider to make some tests if you suspect something is wrong and any feedbacks, contributions and bug reports are always welcome.
|
||||
|
||||
#### Allocations?
|
||||
#### 📌 Allocations?
|
||||
`cglm` doesn't alloc any memory on heap. So it doesn't provide any allocator. You should alloc memory for **out** parameters too if you pass pointer of memory location. Don't forget that **vec4** (also quat/**versor**) and **mat4** must be aligned (16-bytes), because *cglm* uses SIMD instructions to optimize most operations if available.
|
||||
|
||||
#### Returning vector or matrix... ?
|
||||
#### 📌 Returning vector or matrix... ?
|
||||
|
||||
**cglm** supports both *ARRAY API* and *STRUCT API*, so you can return structs if you utilize struct api (`glms_`).
|
||||
|
||||
#### Other APIs like Vulkan, Metal, Dx?
|
||||
Currently *cglm* uses default clip space configuration (-1, 1) for camera functions (perspective, extract corners...), in the future other clip space configurations will be supported
|
||||
|
||||
<hr/>
|
||||
|
||||
<table>
|
||||
@@ -109,7 +106,7 @@ Currently *cglm* uses default clip space configuration (-1, 1) for camera functi
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
## Features
|
||||
## 🚀 Features
|
||||
- **scalar** and **simd** (sse, avx, neon...) optimizations
|
||||
- option to use different clipspaces e.g. Left Handed, Zero-to-One... (currrently right handed negative-one is default)
|
||||
- array api and struct api, you can use arrays or structs.
|
||||
@@ -191,7 +188,7 @@ Struct functions generally take their parameters as *values* and *return* their
|
||||
|
||||
The types used are actually unions that allow access to the same data multiple ways. One of those ways involves anonymous structures, available since C11. MSVC also supports it for earlier C versions out of the box and GCC/Clang do if you enable `-fms-extensions`. To explicitly enable these anonymous structures, `#define CGLM_USE_ANONYMOUS_STRUCT` to `1`, to disable them, to `0`. For backward compatibility, you can also `#define CGLM_NO_ANONYMOUS_STRUCT` (value is irrelevant) to disable them. If you don't specify explicitly, cglm will do a best guess based on your compiler and the C version you're using.
|
||||
|
||||
## Build
|
||||
## 🔨 Build
|
||||
|
||||
### CMake (All platforms)
|
||||
```bash
|
||||
|
||||
Reference in New Issue
Block a user