aboutsummaryrefslogtreecommitdiffstats
path: root/examples/opengl
diff options
context:
space:
mode:
Diffstat (limited to 'examples/opengl')
-rw-r--r--examples/opengl/contextinfo/contextinfo.py12
-rw-r--r--examples/opengl/contextinfo/doc/contextinfo.pngbin0 -> 35022 bytes
-rw-r--r--examples/opengl/contextinfo/doc/contextinfo.rst10
-rw-r--r--examples/opengl/hellogl2/doc/hellogl2.pngbin0 -> 4143 bytes
-rw-r--r--examples/opengl/hellogl2/doc/hellogl2.rst9
-rw-r--r--examples/opengl/hellogl2/hellogl2.py2
-rw-r--r--examples/opengl/textures/doc/textures.pngbin0 -> 38108 bytes
-rw-r--r--examples/opengl/textures/doc/textures.rst9
8 files changed, 35 insertions, 7 deletions
diff --git a/examples/opengl/contextinfo/contextinfo.py b/examples/opengl/contextinfo/contextinfo.py
index 47fd83abc..73b55df13 100644
--- a/examples/opengl/contextinfo/contextinfo.py
+++ b/examples/opengl/contextinfo/contextinfo.py
@@ -245,12 +245,12 @@ class RenderWindow(QWindow):
context_surface_format = print_surface_format(self.context.format())
surface_format = print_surface_format(self.format())
- text = ("Vendor: {gl_vendor}\n"
- "Renderer: {gl_renderer}\n"
- "Version: {gl_version}\n"
- "Shading language: {gl_lang_version}\n"
- "Context Format: {context_surface_format}\n\n"
- "Surface Format: {surface_format}")
+ text = (f"Vendor: {gl_vendor}\n"
+ f"Renderer: {gl_renderer}\n"
+ f"Version: {gl_version}\n"
+ f"Shading language: {gl_lang_version}\n"
+ f"Context Format: {context_surface_format}\n\n"
+ f"Surface Format: {surface_format}")
self.context.doneCurrent()
return text
diff --git a/examples/opengl/contextinfo/doc/contextinfo.png b/examples/opengl/contextinfo/doc/contextinfo.png
new file mode 100644
index 000000000..c7911f162
--- /dev/null
+++ b/examples/opengl/contextinfo/doc/contextinfo.png
Binary files differ
diff --git a/examples/opengl/contextinfo/doc/contextinfo.rst b/examples/opengl/contextinfo/doc/contextinfo.rst
new file mode 100644
index 000000000..1fa9eb42d
--- /dev/null
+++ b/examples/opengl/contextinfo/doc/contextinfo.rst
@@ -0,0 +1,10 @@
+Context Info Example
+====================
+
+The example shows the information about the OpenGL-related graphics
+configuration of the current system. This can be useful as a
+diagnostic tool.
+
+.. image:: contextinfo.png
+ :width: 400
+ :alt: Context Simple Screenshot
diff --git a/examples/opengl/hellogl2/doc/hellogl2.png b/examples/opengl/hellogl2/doc/hellogl2.png
new file mode 100644
index 000000000..674ea9fbe
--- /dev/null
+++ b/examples/opengl/hellogl2/doc/hellogl2.png
Binary files differ
diff --git a/examples/opengl/hellogl2/doc/hellogl2.rst b/examples/opengl/hellogl2/doc/hellogl2.rst
new file mode 100644
index 000000000..1223e138c
--- /dev/null
+++ b/examples/opengl/hellogl2/doc/hellogl2.rst
@@ -0,0 +1,9 @@
+Hello GL2 Example
+=================
+
+The Hello GL2 example demonstrates the basic use of the OpenGL-related classes
+provided with Qt.
+
+.. image:: hellogl2.png
+ :width: 400
+ :alt: Hello GL2 Screenshot
diff --git a/examples/opengl/hellogl2/hellogl2.py b/examples/opengl/hellogl2/hellogl2.py
index 6dfc032ad..2f170dc90 100644
--- a/examples/opengl/hellogl2/hellogl2.py
+++ b/examples/opengl/hellogl2/hellogl2.py
@@ -232,7 +232,7 @@ class GLWidget(QOpenGLWidget, QOpenGLFunctions):
def __init__(self, transparent, parent=None):
QOpenGLWidget.__init__(self, parent)
- super().__init__()
+ QOpenGLFunctions.__init__(self)
self._transparent = transparent
self._core = QSurfaceFormat.defaultFormat().profile() == QSurfaceFormat.CoreProfile
diff --git a/examples/opengl/textures/doc/textures.png b/examples/opengl/textures/doc/textures.png
new file mode 100644
index 000000000..ff80a7d8f
--- /dev/null
+++ b/examples/opengl/textures/doc/textures.png
Binary files differ
diff --git a/examples/opengl/textures/doc/textures.rst b/examples/opengl/textures/doc/textures.rst
new file mode 100644
index 000000000..80bf20451
--- /dev/null
+++ b/examples/opengl/textures/doc/textures.rst
@@ -0,0 +1,9 @@
+Texture Example
+===============
+
+The Textures example demonstrates the use of Qt's image classes as textures in
+applications that use both OpenGL and Qt to display graphics.
+
+.. image:: textures.png
+ :width: 400
+ :alt: Textures Screenshot