summaryrefslogtreecommitdiffstats
path: root/doc/src/snippets/code/src_opengl_qglpixelbuffer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'doc/src/snippets/code/src_opengl_qglpixelbuffer.cpp')
-rw-r--r--doc/src/snippets/code/src_opengl_qglpixelbuffer.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/doc/src/snippets/code/src_opengl_qglpixelbuffer.cpp b/doc/src/snippets/code/src_opengl_qglpixelbuffer.cpp
new file mode 100644
index 0000000..589ffc0
--- /dev/null
+++ b/doc/src/snippets/code/src_opengl_qglpixelbuffer.cpp
@@ -0,0 +1,19 @@
+//! [0]
+QGLPixelBuffer pbuffer(...);
+...
+pbuffer.makeCurrent();
+GLuint dynamicTexture = pbuffer.generateDynamicTexture();
+pbuffer.bindToDynamicTexture(dynamicTexture);
+...
+pbuffer.releaseFromDynamicTexture();
+//! [0]
+
+
+//! [1]
+QGLPixelBuffer pbuffer(...);
+...
+pbuffer.makeCurrent();
+GLuint dynamicTexture = pbuffer.generateDynamicTexture();
+...
+pbuffer.updateDynamicTexture(dynamicTexture);
+//! [1]