Skip to content

Commit b985660

Browse files
authored
Also run example-tests with imgui (#769)
* Also run tests with imgui * add imgui_bundle as a dep for examples
1 parent f7b9223 commit b985660

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

examples/imgui_backend_sea.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
"""
22
An example demonstrating a wgpu app with imgui backend.
33
4-
# run_example = false
54
"""
65

6+
# run_example = true
7+
78
from rendercanvas.auto import RenderCanvas, loop
89
import wgpu
910
import time
@@ -23,7 +24,7 @@
2324

2425
# Prepare present context
2526
present_context = canvas.get_wgpu_context()
26-
render_texture_format = wgpu.TextureFormat.bgra8unorm
27+
render_texture_format = present_context.get_preferred_format(adapter)
2728
present_context.configure(device=device, format=render_texture_format)
2829

2930
module = device.create_shader_module(

examples/imgui_basic_example.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
"""
22
An example demonstrating a wgpu app with basic imgui usage and events.
33
4-
# run_example = false
54
"""
65

6+
# run_example = true
7+
78
import wgpu
89
import sys
910
from imgui_bundle import imgui, imgui_ctx

examples/imgui_renderer_sea.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from imgui_bundle import imgui
1212
from wgpu.utils.imgui import ImguiRenderer, Stats
1313

14+
1415
# Create a canvas to render to, the framerate is unlocked by using the "fastest" update mode and disabling vsync
1516
canvas = RenderCanvas(
1617
title="imgui_sea", size=(800, 450), update_mode="fastest", vsync=False

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ tests = [
3232
"trio",
3333
"rendercanvas>=2.4.0",
3434
]
35-
examples = ["pypng", "rendercanvas", "glfw"]
35+
examples = ["pypng", "rendercanvas", "glfw", "imgui_bundle"]
3636
docs = ["sphinx>7.2", "sphinx_rtd_theme"]
3737
dev = ["wgpu[build,codegen,lint,tests,examples,docs]"]
3838

0 commit comments

Comments
 (0)