| 1 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,39 @@ |
| 1 |
+#include <string> |
|
| 2 |
+ |
|
| 3 |
+#include <gltexture.hpp> |
|
| 4 |
+#include <gltexture1d.hpp> |
|
| 5 |
+#include <gltexture2d.hpp> |
|
| 6 |
+#include <gltexture3d.hpp> |
|
| 7 |
+#include <gltexturebuffer.hpp> |
|
| 8 |
+#include <gltexturecubemap.hpp> |
|
| 9 |
+ |
|
| 10 |
+ |
|
| 11 |
+constexpr auto size = 128; |
|
| 12 |
+ |
|
| 13 |
+ |
|
| 14 |
+template<typename Data> |
|
| 15 |
+void texture(GLuint program, GLTexture * texture0) |
|
| 16 |
+{
|
|
| 17 |
+ // NOLINTNEXTLINE |
|
| 18 |
+ GLTexture::anisotropy(4.0F); |
|
| 19 |
+ |
|
| 20 |
+ glUniform1i( |
|
| 21 |
+ glGetUniformLocation(program, "texture0"), |
|
| 22 |
+ texture0->unit() |
|
| 23 |
+ ); |
|
| 24 |
+ |
|
| 25 |
+ auto const data = texture0->data<Data>(); |
|
| 26 |
+ (void)data; |
|
| 27 |
+ texture0->data({1, 2, 3, 4});
|
|
| 28 |
+ texture0->clear(); |
|
| 29 |
+} |
|
| 30 |
+ |
|
| 31 |
+ |
|
| 32 |
+int main() |
|
| 33 |
+{
|
|
| 34 |
+ GLTexture1D texture1d ("", {size});
|
|
| 35 |
+ GLTexture2D texture2d ("", {size, size});
|
|
| 36 |
+ GLTexture3D texture3d ("", {size, size, size});
|
|
| 37 |
+ GLTextureBuffer<GLfloat> texturebuffer ("", {size});
|
|
| 38 |
+ GLTextureCubemap texturecubemap("", {size, size});
|
|
| 39 |
+} |