Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions packages/pixi-svelte/src/lib/components/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import InitialiseParent from './InitialiseParent.svelte';
import AssetsLoader from './AssetsLoader.svelte';

type Props = { children: Snippet };
type Props = { children: Snippet; rendererPreference?: 'webgpu' | 'webgl' };

const props: Props = $props();
const context = getContextApp();
Expand All @@ -16,7 +16,7 @@
onDestroy(() => context.stateApp.reset());
</script>

<InitialiseApplication>
<InitialiseApplication rendererPreference={props.rendererPreference}>
<InitialiseParent>
<AssetsLoader>
{@render props.children()}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import { getContextApp } from '../context.svelte';
import { preloadFont } from '../utils.svelte';

type Props = { children: Snippet };
type Props = { children: Snippet; rendererPreference?: 'webgpu' | 'webgl' };

const props: Props = $props();
const context = getContextApp();
Expand All @@ -26,7 +26,7 @@
multiView: false,
antialias: true,
clearBeforeRender: true,
preference: 'webgpu',
preference: props.rendererPreference ?? 'webgpu',
powerPreference: 'high-performance',
resolution: devicePixelRatio.current,
resizeTo: window,
Expand Down