| ... | ... |
@@ -8,6 +8,20 @@ A [C++11][]/[OpenGL][] [\>=2.0][] [texture][] library. |
| 8 | 8 |
[\>=2.0]: https://en.wikipedia.org/wiki/OpenGL#Version_history |
| 9 | 9 |
[texture]: https://www.khronos.org/opengl/wiki/Texture |
| 10 | 10 |
|
| 11 |
+## Usage |
|
| 12 |
+ |
|
| 13 |
+### Texture units |
|
| 14 |
+ |
|
| 15 |
+**Note** that since the allocation of texture units is handled automatically |
|
| 16 |
+the only texture unit that is free for use by clients is `GL_TEXTURE0`. |
|
| 17 |
+ |
|
| 18 |
+## Implementation notes |
|
| 19 |
+ |
|
| 20 |
+The [Common mistakes][] article on the Khronos OpenGL Wiki has some good |
|
| 21 |
+texture-related content. |
|
| 22 |
+ |
|
| 23 |
+[Common mistakes]: https://www.khronos.org/opengl/wiki/Common_Mistakes |
|
| 24 |
+ |
|
| 11 | 25 |
## Build system |
| 12 | 26 |
|
| 13 | 27 |
This project supports [CMake][] and uses [`cmake-common`][]. There are several |
| ... | ... |
@@ -8,6 +8,95 @@ A [C++11][]/[OpenGL][] [\>=2.0][] [texture][] library. |
| 8 | 8 |
[\>=2.0]: https://en.wikipedia.org/wiki/OpenGL#Version_history |
| 9 | 9 |
[texture]: https://www.khronos.org/opengl/wiki/Texture |
| 10 | 10 |
|
| 11 |
+## Build system |
|
| 12 |
+ |
|
| 13 |
+This project supports [CMake][] and uses [`cmake-common`][]. There are several |
|
| 14 |
+ways to use it in other CMake-based projects: |
|
| 15 |
+ |
|
| 16 |
+- With [`find_package`][]: ([Package][] and) [install][] it on the system. |
|
| 17 |
+ |
|
| 18 |
+- With [`add_subdirectory`][]: Bundle it. |
|
| 19 |
+ |
|
| 20 |
+- With [`FetchContent`][]: Download it as part of the CMake configure step. |
|
| 21 |
+ |
|
| 22 |
+- With [`cmake-common`][]: Use any of the above methods through a simplified |
|
| 23 |
+ interface. |
|
| 24 |
+ |
|
| 25 |
+As usual, use [`add_dependencies`][] or [`target_link_libraries`][] (or |
|
| 26 |
+`cmake-common`'s `DEPENDENCIES_*`) to declare the dependency. |
|
| 27 |
+ |
|
| 28 |
+[CMake]: https://cmake.org |
|
| 29 |
+[`cmake-common`]: https://git.rcrnstn.net/rcrnstn/cmake-common |
|
| 30 |
+[`FetchContent`]: https://cmake.org/cmake/help/v3.14/module/FetchContent.html |
|
| 31 |
+[`add_subdirectory`]: https://cmake.org/cmake/help/v3.14/command/add_subdirectory.html |
|
| 32 |
+[`find_package`]: https://cmake.org/cmake/help/v3.14/command/find_package.html |
|
| 33 |
+[Package]: #Package |
|
| 34 |
+[Install]: #Install |
|
| 35 |
+[`add_dependencies`]: https://cmake.org/cmake/help/v3.14/command/add_dependencies.html |
|
| 36 |
+[`target_link_libraries`]: https://cmake.org/cmake/help/v3.14/command/target_link_libraries.html |
|
| 37 |
+ |
|
| 38 |
+### Configure and generate |
|
| 39 |
+ |
|
| 40 |
+To configure and generate a build tree, use `cmake`: |
|
| 41 |
+ |
|
| 42 |
+```sh |
|
| 43 |
+cmake -B _build |
|
| 44 |
+``` |
|
| 45 |
+ |
|
| 46 |
+To set the build type, pass e.g. `-D`[`CMAKE_BUILD_TYPE`][]`=Release`. |
|
| 47 |
+ |
|
| 48 |
+[`cmake`]: https://cmake.org/cmake/help/v3.14/manual/cmake.1.html#generate-a-project-buildsystem |
|
| 49 |
+[`CMAKE_BUILD_TYPE`]: https://cmake.org/cmake/help/v3.14/variable/CMAKE_BUILD_TYPE.html |
|
| 50 |
+ |
|
| 51 |
+### Build |
|
| 52 |
+ |
|
| 53 |
+To build, use [`cmake --build`][]: |
|
| 54 |
+ |
|
| 55 |
+```sh |
|
| 56 |
+cmake --build _build |
|
| 57 |
+``` |
|
| 58 |
+ |
|
| 59 |
+To disable building tests, pass `-D`[`BUILD_TESTING`][]`=OFF`. |
|
| 60 |
+ |
|
| 61 |
+[`cmake --build`]: https://cmake.org/cmake/help/v3.14/manual/cmake.1.html#build-a-project |
|
| 62 |
+[`BUILD_TESTING`]: https://cmake.org/cmake/help/v3.14/module/CTest.html |
|
| 63 |
+ |
|
| 64 |
+### Test |
|
| 65 |
+ |
|
| 66 |
+To run tests, use [`ctest`][]: |
|
| 67 |
+ |
|
| 68 |
+```sh |
|
| 69 |
+(cd _build && ctest) |
|
| 70 |
+``` |
|
| 71 |
+ |
|
| 72 |
+To show output from failing tests, pass `--output-on-failure`. To show output |
|
| 73 |
+from all tests, pass `--verbose`. |
|
| 74 |
+ |
|
| 75 |
+[`ctest`]: https://cmake.org/cmake/help/v3.14/manual/ctest.1.html |
|
| 76 |
+ |
|
| 77 |
+### Package |
|
| 78 |
+ |
|
| 79 |
+To package, use [`cpack`][]: |
|
| 80 |
+ |
|
| 81 |
+```sh |
|
| 82 |
+(cd _build && cpack) |
|
| 83 |
+``` |
|
| 84 |
+ |
|
| 85 |
+[`cpack`]: https://cmake.org/cmake/help/v3.14/manual/cpack.1.html |
|
| 86 |
+ |
|
| 87 |
+### Install |
|
| 88 |
+ |
|
| 89 |
+To install onto the current system, use [`cmake --install`][]: |
|
| 90 |
+ |
|
| 91 |
+```sh |
|
| 92 |
+cmake --install _build |
|
| 93 |
+``` |
|
| 94 |
+ |
|
| 95 |
+To set the prefix, pass e.g. `-D`[`CMAKE_INSTALL_PREFIX`][]`="$HOME/.local"`. |
|
| 96 |
+ |
|
| 97 |
+[`cmake --install`]: https://cmake.org/cmake/help/v3.14/manual/cmake.1.html#install-a-project |
|
| 98 |
+[`CMAKE_INSTALL_PREFIX`]: https://cmake.org/cmake/help/v3.14/variable/CMAKE_INSTALL_PREFIX.html |
|
| 99 |
+ |
|
| 11 | 100 |
## License |
| 12 | 101 |
|
| 13 | 102 |
Licensed under the [ISC License][] unless otherwise noted, see the |
| ... | ... |
@@ -7,3 +7,10 @@ A [C++11][]/[OpenGL][] [\>=2.0][] [texture][] library. |
| 7 | 7 |
[OpenGL]: https://en.wikipedia.org/wiki/OpenGL |
| 8 | 8 |
[\>=2.0]: https://en.wikipedia.org/wiki/OpenGL#Version_history |
| 9 | 9 |
[texture]: https://www.khronos.org/opengl/wiki/Texture |
| 10 |
+ |
|
| 11 |
+## License |
|
| 12 |
+ |
|
| 13 |
+Licensed under the [ISC License][] unless otherwise noted, see the |
|
| 14 |
+[`LICENSE`](LICENSE) file. |
|
| 15 |
+ |
|
| 16 |
+[ISC License]: https://choosealicense.com/licenses/isc/ |
| 1 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,9 @@ |
| 1 |
+# [`gltexture`][] |
|
| 2 |
+ |
|
| 3 |
+A [C++11][]/[OpenGL][] [\>=2.0][] [texture][] library. |
|
| 4 |
+ |
|
| 5 |
+[`gltexture`]: https://git.rcrnstn.net/rcrnstn/gltexture |
|
| 6 |
+[C++11]: https://en.wikipedia.org/wiki/C++11 |
|
| 7 |
+[OpenGL]: https://en.wikipedia.org/wiki/OpenGL |
|
| 8 |
+[\>=2.0]: https://en.wikipedia.org/wiki/OpenGL#Version_history |
|
| 9 |
+[texture]: https://www.khronos.org/opengl/wiki/Texture |