Skip to content
Merged
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
8 changes: 4 additions & 4 deletions packages/core/src/core/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ export class Core {
public async run(): Promise<void> {
const context = this.getExecutionContext();
const libraries = this.config.libraryManager.getRunnerLibraries();
const interval = setInterval(async () => {
const runner = async () => {
if (!context.isRunning) {
clearInterval(interval);
this.runClear(this.getClearContext());
return;
}
await this.runExecute(context, libraries);
}, 200);
requestAnimationFrame(runner);
};
requestAnimationFrame(runner);
}

private getInitContext(options: IRunOptions): InitContext {
Expand Down
8 changes: 1 addition & 7 deletions packages/graphics-2d/src/render.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { type InitContext } from "@nanoforge/common";

import { type NfgComponent } from "./components/component";
import { type NfgComponent } from "./components";
import { type GraphicsCore } from "./core";

export class GraphicsRender {
Expand Down Expand Up @@ -44,7 +44,6 @@ export class GraphicsRender {
}

private _beginRender(): [GPUCommandEncoder, GPURenderPassEncoder] {
console.log(1);
const encoder = this._core.device.createCommandEncoder();

const pass = encoder.beginRenderPass({
Expand All @@ -69,11 +68,6 @@ export class GraphicsRender {

private _endRender(pass: GPURenderPassEncoder, encoder: GPUCommandEncoder): void {
pass.end();
console.log(pass);
this._core.device.queue.submit([encoder.finish()]);
this._core.device.queue.onSubmittedWorkDone().then(() => {
console.log("Done");
});
console.log(this._core.device.queue);
}
}
Loading