Skip to content

Commit 60a9a84

Browse files
committed
add quad count to fps
1 parent 1a8eb3c commit 60a9a84

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/primitives/FPSCounter.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ const [fps, setFps] = createSignal(0);
2727
const [avgFps, setAvgFps] = createSignal(0);
2828
const [minFps, setMinFps] = createSignal(99);
2929
const [maxFps, setMaxFps] = createSignal(0);
30+
const [quads, setQuads] = createSignal(0);
3031
const [criticalThresholdSignal, setCriticalThresholdSignal] = createSignal('');
3132
const [targetThresholdSignal, setTargetThresholdSignal] = createSignal('');
3233
const [renderableMemUsedSignal, setRenderableMemUsedSignal] = createSignal('');
@@ -86,6 +87,10 @@ export function setupFPS(root: any) {
8687
frameCount++;
8788
}
8889
});
90+
91+
root.renderer.on('quadsUpdate', (target: RendererMain, quadsData: any) => {
92+
setQuads(quadsData.quads);
93+
});
8994
}
9095

9196
export const FPSCounter = (props: NodeProps) => {
@@ -173,6 +178,15 @@ export const FPSCounter = (props: NodeProps) => {
173178
{loadedTexturesSignal().toString()}
174179
</text>
175180
</view>
181+
182+
<view height={infoFontSize}>
183+
<text fontSize={infoFontSize} style={fpsLabel}>
184+
quads:
185+
</text>
186+
<text fontSize={infoFontSize} style={fpsLabel} x={230}>
187+
{quads().toString()}
188+
</text>
189+
</view>
176190
</view>
177191
</view>
178192
);

0 commit comments

Comments
 (0)