Skip to content

WebGPU GLFW and SDL2 examples #8381

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
7454770
ImGui WebGPU examples: removed swap-chain in favor of surfaceConfigur…
BrutPitt Feb 7, 2025
714f33e
Adjustment in struct WGPUVertexAttribute for changes of the last rele…
BrutPitt Feb 7, 2025
ecf85a5
New SDL2 WGPU example
BrutPitt Feb 7, 2025
cfa5745
Code optimization: removed the redundancies of assignment
BrutPitt Feb 7, 2025
09e3232
Changes: ImGui code style - Lambdas RequestAdapter and RequestDevice …
BrutPitt Feb 12, 2025
b93b239
Same changes of GLFW example: ImGui code style - Lambdas RequestAdapt…
BrutPitt Feb 12, 2025
2e95e72
Scrollbars inhibition
BrutPitt Feb 17, 2025
927b7be
Use of new direct CreateDevice function (w/o callback), added release…
BrutPitt Feb 17, 2025
c91bf8b
Merge branch 'master' into master
BrutPitt Mar 4, 2025
ac73476
If the O.S. is Linux/Unix check if Wayland is the current active sess…
BrutPitt Mar 4, 2025
674c794
example_glfw_wgpu: removed all workarounds
BrutPitt Mar 4, 2025
979e640
example_sdl2_wgpu: same style and functionality as GLFW example
BrutPitt Mar 4, 2025
8b08198
sdl2wgpu tool to acquire surfaceDescriptor via SDL_syswm and to pass …
BrutPitt Mar 4, 2025
1f82f4e
Merge branch 'ocornut:master' into master
BrutPitt Mar 12, 2025
ed8cea6
Merge branch 'ocornut:master' into master
BrutPitt Mar 16, 2025
1419d1c
Merge branch 'ocornut:master' into master
BrutPitt Mar 24, 2025
a203864
css style to avoid the scrollbar
BrutPitt Mar 25, 2025
d60af09
added `chek_surface_texture_status` function to check the `WGPUSurfac…
BrutPitt Mar 25, 2025
8becaa3
Changed comment reference to `emwgpudawn` an EMSCRIPTEN WGPU binding …
BrutPitt Mar 25, 2025
b6e4ffd
Merge remote-tracking branch 'origin/master'
BrutPitt Mar 25, 2025
e4c6d5c
Adaptation to the last Google DAWN commit: 1411699ba4cdf29eca037c4320…
BrutPitt Mar 31, 2025
8f8327b
Merge branch 'ocornut:master' into master
BrutPitt Apr 1, 2025
5f371da
Merge remote-tracking branch 'origin/master'
BrutPitt Mar 31, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions backends/imgui_impl_wgpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,7 @@ bool ImGui_ImplWGPU_CreateDeviceObjects()
// Vertex input configuration
WGPUVertexAttribute attribute_desc[] =
{

#ifdef IMGUI_IMPL_WEBGPU_BACKEND_DAWN
{ nullptr, WGPUVertexFormat_Float32x2, (uint64_t)offsetof(ImDrawVert, pos), 0 },
{ nullptr, WGPUVertexFormat_Float32x2, (uint64_t)offsetof(ImDrawVert, uv), 1 },
Expand Down
9 changes: 9 additions & 0 deletions examples/example_glfw_wgpu/CMakeLists.txt
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,15 @@ else()
option(TINT_BUILD_WGSL_WRITER "Build the WGSL output writer" ON)
endif()

# check if WAYLAND is the current Session Type and enable DAWN_USE_WAYLAND Wayland option @compile time
# You can override this using: cmake -DDAWN_USE_WAYLAND=X (X = ON | OFF)
if(UNIX)
if ($ENV{XDG_SESSION_TYPE} MATCHES wayland)
option(DAWN_USE_WAYLAND "Enable support for Wayland surface" ON)
endif()
endif()


add_subdirectory("${IMGUI_DAWN_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/dawn" EXCLUDE_FROM_ALL)

set(LIBRARIES webgpu_dawn webgpu_cpp webgpu_glfw glfw)
Expand Down
Loading