新增 marchtoy #70

Merged
Passthem merged 15 commits from bkbkzzzz/konabot:marchtoy_gl into master 2026-04-27 02:42:19 +08:00
17 changed files with 1962 additions and 1066 deletions
Showing only changes of commit 197535cd34 - Show all commits

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,