garbage collection

This commit is contained in:
alcoholicgirl
2026-04-27 00:00:12 +08:00
parent c3c22e7145
commit 197535cd34

View File

@ -6,12 +6,14 @@ import moderngl
import numpy as np
from PIL import Image
from konabot.plugins.marchtoy.command import Scene
async def render(instruction: str, res: tuple[int, int]):
fs = Scene(instruction).compile()
async def render(command: str, res: tuple[int, int]):
fs = Scene(command).compile()
PATH = pathlib.Path(__file__).parent / "shaders"
with (PATH / "vert.glsl").open(encoding='utf-8') as f:
vs = f.read()
ctx = moderngl.create_context(standalone=True)
ctx.gc_mode = "auto"
try:
program = ctx.program(
vertex_shader=vs,