feat(windows): embed Bloom in a host window via bloom_attach_hwnd (Perry UI BloomView, #2395)#70
Open
proggeramlug wants to merge 1 commit into
Open
feat(windows): embed Bloom in a host window via bloom_attach_hwnd (Perry UI BloomView, #2395)#70proggeramlug wants to merge 1 commit into
proggeramlug wants to merge 1 commit into
Conversation
…rry UI BloomView, #2395) Lets Bloom render into a host-provided child window instead of always creating its own top-level window — the engine side of the Perry UI `BloomView` widget (PerryTS/perry#5518), analogous to Flame inside Flutter. - native/windows/src/lib.rs: factor the wgpu surface + engine init out of bloom_init_window into init_engine_for_hwnd, shared with a new FFI bloom_attach_hwnd(hwnd, w, h). It builds the surface on the host HWND and classic-subclasses it (WM_SIZE/keyboard/mouse → engine). Add bloom_resize, an EMBEDDED flag (begin_drawing skips its own message pump; should_close reports "stay open" since the host owns the loop). - src/core/index.ts: attachToHwnd / resize TS wrappers (+ src/index.ts export). - package.json: declare bloom_attach_hwnd / bloom_resize in the native-library function manifest. - embed-perry/: a demo Perry UI app embedding a live Bloom 3D scene (requires the BloomView Perry build from PerryTS/perry#5518 to compile/run). Windows only for now; per-platform attach (NSView/UIView/dmabuf) is a follow-up.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The engine side of the Perry UI
BloomViewwidget (PerryTS/perry#5518) — lets Bloom render into a host-provided window instead of always creating its own top-level window, so it can live as a render view inside a normal Perry UI app (analogous to Flame inside Flutter). Pairs with perry-issue #2395.Changes
native/windows/src/lib.rs: factor the wgpu surface + engine init out ofbloom_init_windowintoinit_engine_for_hwnd, shared with a new FFI:bloom_attach_hwnd(hwnd, w, h)— build the surface on a host-provided HWND and classic-subclass it so Bloom still seesWM_SIZE/ keyboard / mouse (its own wndproc never runs for a foreign-class window), then chain to the original proc.bloom_resize(physW, physH, logW, logH)— explicit resize.EMBEDDEDflag:bloom_begin_drawingskips its own message pump (the host owns the loop) andbloom_window_should_closereports "stay open".src/core/index.ts:attachToHwnd/resizeTS wrappers (re-exported fromsrc/index.ts).package.json: declarebloom_attach_hwnd/bloom_resizein the native-library function manifest so Perry links them.embed-perry/: a demo Perry UI app that embeds a live Bloom 3D scene.Usage
The host owns the message loop, so drive frames yourself (don't call
runGame, which blocks).Status
BloomViewwidget already links on all targets.embed-perry/demo compiles and renders a live, animating 3D scene inside a Perry UI window, including resize (seeembed-perry/bloomFull.png).BloomViewPerry build from feat(ui): BloomView — embed the Bloom engine in a Perry UI app (#2395) PerryTS/perry#5518 to compile/run.🔗 Perry-side PR: PerryTS/perry#5518