garbage collection
This commit is contained in:
@ -6,12 +6,14 @@ import moderngl
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
from PIL import Image
|
from PIL import Image
|
||||||
from konabot.plugins.marchtoy.command import Scene
|
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"
|
PATH = pathlib.Path(__file__).parent / "shaders"
|
||||||
with (PATH / "vert.glsl").open(encoding='utf-8') as f:
|
with (PATH / "vert.glsl").open(encoding='utf-8') as f:
|
||||||
vs = f.read()
|
vs = f.read()
|
||||||
ctx = moderngl.create_context(standalone=True)
|
ctx = moderngl.create_context(standalone=True)
|
||||||
|
ctx.gc_mode = "auto"
|
||||||
try:
|
try:
|
||||||
program = ctx.program(
|
program = ctx.program(
|
||||||
vertex_shader=vs,
|
vertex_shader=vs,
|
||||||
|
|||||||
Reference in New Issue
Block a user