This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os, time | |
from pygame._sdl2 import mixer | |
class AudioEngine: | |
Q={'low':(11025,-8,1,512),'medium':(22050,-16,1,1024),'high':(44100,-16,2,2048),'ultra':(48000,-16,2,4096)} | |
def __init__(self, quality='high'): | |
if quality not in self.Q: raise ValueError | |
f=self.Q[quality]; mixer.init(*f) | |
def find_file(self,b,exts): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os, time | |
from pygame._sdl2 import mixer as m | |
class AE: | |
Q={'low':(11025,-8,1,512),'medium':(22050,-16,1,1024),'high':(44100,-16,2,2048),'ultra':(48000,-16,2,4096)} | |
def __init__(self,q='high'): | |
f=self.Q[q];m.init(f[0],f[1],f[2],f[3]) | |
def f(self,b,exts): | |
for e in exts: | |
n=f"{b}.{e}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import time | |
import pygame._sdl2.mixer as mixer | |
class AudioEngine: | |
AUDIO_QUALITIES = { | |
"low": { | |
"frequency": 11025, | |
"size": -8, | |
"channels": 1, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import time | |
import pygame._sdl2.mixer as mixer | |
# === Audio Quality Presets === | |
AUDIO_QUALITIES = { | |
"low": { | |
"frequency": 11025, | |
"size": -8, | |
"channels": 1, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// stb_image_wrapper.c - Safe, optimized stb_image DLL interface | |
#define STB_IMAGE_IMPLEMENTATION | |
#include "stb_image.h" | |
#ifdef __cplusplus | |
extern "C" { | |
#endif | |
// ----------------------------- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ctypes | |
from ctypes import ( | |
c_char_p, c_wchar_p, c_int, c_ubyte, c_ushort, c_float, | |
POINTER, c_void_p | |
) | |
import os | |
import platform | |
import sys | |
# ---------- Load DLL ---------- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import heapq | |
import re | |
import numpy as np | |
from OpenGL.GL import * | |
from stb import image | |
# === Global registries & ID recycling heap === | |
_images = {} # auto-named images | |
_named_images = {} # user-named images | |
_next_id = 1 |